Updated settings UI

This commit is contained in:
Kieran Eglin 2024-06-03 16:36:47 -07:00
parent bf6b727224
commit 2f47677af6
No known key found for this signature in database
GPG key ID: 193984967FCF432D
3 changed files with 19 additions and 25 deletions

View file

@ -1,8 +1,6 @@
defmodule PinchflatWeb.Settings.SettingHTML do defmodule PinchflatWeb.Settings.SettingHTML do
use PinchflatWeb, :html use PinchflatWeb, :html
alias Pinchflat.Downloading.CodecParser
embed_templates "setting_html/*" embed_templates "setting_html/*"
@doc """ @doc """

View file

@ -1,17 +1,17 @@
<aside> <aside>
<h2 class="text-xl font-bold mb-2">Codec Preferences</h2> <h2 class="text-xl font-bold mb-2">Codec Preference</h2>
<section class="ml-2 md:ml-4 mb-2 max-w-prose"> <section class="ml-2 md:ml-4 mb-2 max-w-prose">
<section> <p>
Available video codecs: Some users may want to specify the audio codec that <code class="text-sm">yt-dlp</code>
<ul class="list-disc ml-8"> searches for when downloading content. For these users, you can specify one audio and video
<li :for={{codec, _} <- CodecParser.video_codec_map()}><%= codec %></li> codec to prefer above all others.
</ul> </p>
</section> <p class="mt-4">
<section class="mt-4"> NOTE: this is a <em>soft</em>
Available audio codecs: preference. If the codec you specify is not available, <code class="text-sm">yt-dlp</code>
<ul class="list-disc ml-8"> will download the next best available codec. This is expected and intended behavior.
<li :for={{codec, _} <- CodecParser.audio_codec_map()}><%= codec %></li> <.inline_link href="https://github.com/yt-dlp/yt-dlp#sorting-formats">See here</.inline_link>
</ul> for more information and a list of available codecs.
</section> </p>
</section> </section>
</aside> </aside>

View file

@ -37,24 +37,20 @@
</p> </p>
<.input <.input
id="video_codec_preference_string" field={f[:video_codec_preference]}
name="setting[video_codec_preference_string]" placeholder="avc"
value={Enum.join(f[:video_codec_preference].value, ">")}
placeholder="avc>vp9>av01"
type="text" type="text"
label="Video Codec Preference" label="Video Codec Preference"
help="Order of preference for video codecs. Separate with >. Will be remuxed into an MP4 container. See below for available codecs" help="Video codec preference. Will be remuxed into an MP4 container. See below for more details"
inputclass="font-mono text-sm mr-4" inputclass="font-mono text-sm mr-4"
/> />
<.input <.input
id="audio_codec_preference_string" field={f[:audio_codec_preference]}
name="setting[audio_codec_preference_string]" placeholder="m4a"
value={Enum.join(f[:audio_codec_preference].value, ">")}
placeholder="mp4a>opus>aac"
type="text" type="text"
label="Audio Codec Preference" label="Audio Codec Preference"
help="Order of preference for audio codecs. Separate with >. See below for available codecs" help="Audio codec preference. See below for more details"
inputclass="font-mono text-sm mr-4" inputclass="font-mono text-sm mr-4"
/> />
</section> </section>