Adds UI for audio_track to the media profile form
This commit is contained in:
parent
fa22580094
commit
a2cc4e78ff
3 changed files with 15 additions and 2 deletions
|
|
@ -54,8 +54,11 @@ defmodule Pinchflat.Downloading.QualityOptionBuilder do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Reminder to self: this conflicts with `--extractor-args "youtube:lang=<LANG>"`
|
||||||
|
# since that will translate the format_notes as well, which means they may not match.
|
||||||
|
# At least that's what happens now - worth a re-check if I have to come back to this
|
||||||
defp build_format_modifier("original"), do: "format_note*=original"
|
defp build_format_modifier("original"), do: "format_note*=original"
|
||||||
defp build_format_modifier("default"), do: "format_note*=(default)"
|
defp build_format_modifier("default"), do: "format_note*='(default)'"
|
||||||
# This uses the carat to anchor the language to the beginning of the string
|
# This uses the carat to anchor the language to the beginning of the string
|
||||||
# since that's what's needed to match `en` to `en-US` and `en-GB`, etc. The user
|
# since that's what's needed to match `en` to `en-US` and `en-GB`, etc. The user
|
||||||
# can always specify the full language code if they want.
|
# can always specify the full language code if they want.
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,16 @@
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section x-show="advancedMode">
|
||||||
|
<.input
|
||||||
|
field={f[:audio_track]}
|
||||||
|
placeholder="de"
|
||||||
|
type="text"
|
||||||
|
label="Audio Track Language"
|
||||||
|
help="Only works if there are multiple audio tracks. Use either a language code, 'original' for the original audio track, or 'default' for YouTube's preference. Or just leave it blank"
|
||||||
|
/>
|
||||||
|
</section>
|
||||||
|
|
||||||
<h3 class="mt-10 text-2xl text-black dark:text-white">
|
<h3 class="mt-10 text-2xl text-black dark:text-white">
|
||||||
Thumbnail Options
|
Thumbnail Options
|
||||||
</h3>
|
</h3>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ defmodule Pinchflat.Downloading.QualityOptionBuilderTest do
|
||||||
|
|
||||||
assert res = QualityOptionBuilder.build(media_profile)
|
assert res = QualityOptionBuilder.build(media_profile)
|
||||||
|
|
||||||
assert {:format, "bestvideo+bestaudio[format_note*=(default)]/bestvideo*+bestaudio/best"} in res
|
assert {:format, "bestvideo+bestaudio[format_note*='(default)']/bestvideo*+bestaudio/best"} in res
|
||||||
end
|
end
|
||||||
|
|
||||||
test "includes format options if audio_track is set to a language code" do
|
test "includes format options if audio_track is set to a language code" do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue