fix credo warnings

This commit is contained in:
zafer
2024-05-22 17:53:10 +03:00
parent 8395d38243
commit d7c75f36c5
6 changed files with 14 additions and 13 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ defmodule Algora.Util do
"your" "your"
] ]
def is_common_word(s), do: Enum.member?(@common_words, s) def common_word?(s), do: Enum.member?(@common_words, s)
def random_string do def random_string do
binary = << binary = <<
+1 -3
View File
@@ -23,13 +23,11 @@ defmodule Algora.Workers.Transcriber do
send(job_pid, {:progress, progress}) send(job_pid, {:progress, progress})
end) end)
output = _output =
await_prediction(prediction.id, fn progress -> await_prediction(prediction.id, fn progress ->
send(job_pid, {:progress, progress}) send(job_pid, {:progress, progress})
end) end)
dbg(output)
send(job_pid, {:complete, video}) send(job_pid, {:complete, video})
rescue rescue
e -> e ->
+1 -1
View File
@@ -147,5 +147,5 @@ defmodule AlgoraWeb.UserAuth do
defp maybe_store_return_to(conn), do: conn defp maybe_store_return_to(conn), do: conn
def signed_in_path(conn), do: "/" def signed_in_path(_conn), do: "/"
end end
+5 -5
View File
@@ -202,10 +202,10 @@ defmodule AlgoraWeb.COSSGPTLive do
@impl true @impl true
def mount(params, _session, socket) do def mount(params, _session, socket) do
socket = socket =
if !params["query"] do if params["query"] do
socket |> push_navigate(to: ~p"/cossgpt?#{%{query: "Benefits of going open source"}}")
else
socket socket
else
socket |> push_navigate(to: ~p"/cossgpt?#{%{query: "Benefits of going open source"}}")
end end
{:ok, socket} {:ok, socket}
@@ -299,8 +299,8 @@ defmodule AlgoraWeb.COSSGPTLive do
String.length(s1) >= 3 and String.length(s1) >= 3 and
String.length(s2) >= 3 and String.length(s2) >= 3 and
(String.contains?(s1, s2) or String.contains?(s2, s1)) and (String.contains?(s1, s2) or String.contains?(s2, s1)) and
!Util.is_common_word(s1) and !Util.common_word?(s1) and
!Util.is_common_word(s2) !Util.common_word?(s2)
end) end)
end end
end end
+2 -2
View File
@@ -268,8 +268,8 @@ defmodule AlgoraWeb.COSSGPTOGLive do
String.length(s1) >= 3 and String.length(s1) >= 3 and
String.length(s2) >= 3 and String.length(s2) >= 3 and
(String.contains?(s1, s2) or String.contains?(s2, s1)) and (String.contains?(s1, s2) or String.contains?(s2, s1)) and
!Util.is_common_word(s1) and !Util.common_word?(s1) and
!Util.is_common_word(s2) !Util.common_word?(s2)
end) end)
end end
end end
+4 -1
View File
@@ -5,6 +5,8 @@ defmodule AlgoraWeb.SettingsLive do
alias Algora.Accounts.Destination alias Algora.Accounts.Destination
alias AlgoraWeb.RTMPDestinationIconComponent alias AlgoraWeb.RTMPDestinationIconComponent
@env Mix.env()
def render(assigns) do def render(assigns) do
~H""" ~H"""
<div class="max-w-3xl mx-auto pt-2 pb-6 px-4 sm:px-6 space-y-6"> <div class="max-w-3xl mx-auto pt-2 pb-6 px-4 sm:px-6 space-y-6">
@@ -80,7 +82,7 @@ defmodule AlgoraWeb.SettingsLive do
<.button phx-click="show_add_destination_modal">Add Destination</.button> <.button phx-click="show_add_destination_modal">Add Destination</.button>
</div> </div>
</div> </div>
<div :if={Mix.env() == :dev} class="space-y-6 bg-white/5 rounded-lg p-6 ring-1 ring-white/15"> <div :if={@env == :dev} class="space-y-6 bg-white/5 rounded-lg p-6 ring-1 ring-white/15">
<.header> <.header>
Integrations Integrations
<:subtitle> <:subtitle>
@@ -133,6 +135,7 @@ defmodule AlgoraWeb.SettingsLive do
{:ok, {:ok,
socket socket
|> assign(env: @env)
|> assign(current_user: current_user) |> assign(current_user: current_user)
|> assign_form(changeset) |> assign_form(changeset)
|> assign(destinations: destinations) |> assign(destinations: destinations)