mirror of
https://github.com/algora-io/tv.git
synced 2024-11-16 00:58:59 +02:00
fix credo warnings
This commit is contained in:
parent
8395d38243
commit
d7c75f36c5
@ -82,7 +82,7 @@ defmodule Algora.Util do
|
||||
"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
|
||||
binary = <<
|
||||
|
@ -23,13 +23,11 @@ defmodule Algora.Workers.Transcriber do
|
||||
send(job_pid, {:progress, progress})
|
||||
end)
|
||||
|
||||
output =
|
||||
_output =
|
||||
await_prediction(prediction.id, fn progress ->
|
||||
send(job_pid, {:progress, progress})
|
||||
end)
|
||||
|
||||
dbg(output)
|
||||
|
||||
send(job_pid, {:complete, video})
|
||||
rescue
|
||||
e ->
|
||||
|
@ -147,5 +147,5 @@ defmodule AlgoraWeb.UserAuth do
|
||||
|
||||
defp maybe_store_return_to(conn), do: conn
|
||||
|
||||
def signed_in_path(conn), do: "/"
|
||||
def signed_in_path(_conn), do: "/"
|
||||
end
|
||||
|
@ -202,10 +202,10 @@ defmodule AlgoraWeb.COSSGPTLive do
|
||||
@impl true
|
||||
def mount(params, _session, socket) do
|
||||
socket =
|
||||
if !params["query"] do
|
||||
socket |> push_navigate(to: ~p"/cossgpt?#{%{query: "Benefits of going open source"}}")
|
||||
else
|
||||
if params["query"] do
|
||||
socket
|
||||
else
|
||||
socket |> push_navigate(to: ~p"/cossgpt?#{%{query: "Benefits of going open source"}}")
|
||||
end
|
||||
|
||||
{:ok, socket}
|
||||
@ -299,8 +299,8 @@ defmodule AlgoraWeb.COSSGPTLive do
|
||||
String.length(s1) >= 3 and
|
||||
String.length(s2) >= 3 and
|
||||
(String.contains?(s1, s2) or String.contains?(s2, s1)) and
|
||||
!Util.is_common_word(s1) and
|
||||
!Util.is_common_word(s2)
|
||||
!Util.common_word?(s1) and
|
||||
!Util.common_word?(s2)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
@ -268,8 +268,8 @@ defmodule AlgoraWeb.COSSGPTOGLive do
|
||||
String.length(s1) >= 3 and
|
||||
String.length(s2) >= 3 and
|
||||
(String.contains?(s1, s2) or String.contains?(s2, s1)) and
|
||||
!Util.is_common_word(s1) and
|
||||
!Util.is_common_word(s2)
|
||||
!Util.common_word?(s1) and
|
||||
!Util.common_word?(s2)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
@ -5,6 +5,8 @@ defmodule AlgoraWeb.SettingsLive do
|
||||
alias Algora.Accounts.Destination
|
||||
alias AlgoraWeb.RTMPDestinationIconComponent
|
||||
|
||||
@env Mix.env()
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<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>
|
||||
</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>
|
||||
Integrations
|
||||
<:subtitle>
|
||||
@ -133,6 +135,7 @@ defmodule AlgoraWeb.SettingsLive do
|
||||
|
||||
{:ok,
|
||||
socket
|
||||
|> assign(env: @env)
|
||||
|> assign(current_user: current_user)
|
||||
|> assign_form(changeset)
|
||||
|> assign(destinations: destinations)
|
||||
|
Loading…
Reference in New Issue
Block a user