diff --git a/lib/pinchflat/downloading/quality_option_builder.ex b/lib/pinchflat/downloading/quality_option_builder.ex index d000ffb..b7edc8f 100644 --- a/lib/pinchflat/downloading/quality_option_builder.ex +++ b/lib/pinchflat/downloading/quality_option_builder.ex @@ -27,9 +27,10 @@ defmodule Pinchflat.Downloading.QualityOptionBuilder do # TODO: pass in the entire media profile once we have the language preference column # TODO: test + # TODO: Set to ba/b if it's audio-only defp build_format_string(language_preference) do if language_preference do - ["bestvideo*+bestaudio[#{build_format_modifier(language_preference)}]/bestvideo*+bestaudio/best"] + ["bestvideo+bestaudio[#{build_format_modifier(language_preference)}]/bestvideo*+bestaudio/best"] else ["bestvideo*+bestaudio/best"] end diff --git a/lib/pinchflat/profiles/media_profile.ex b/lib/pinchflat/profiles/media_profile.ex index 3158bdf..0d156e9 100644 --- a/lib/pinchflat/profiles/media_profile.ex +++ b/lib/pinchflat/profiles/media_profile.ex @@ -26,6 +26,7 @@ defmodule Pinchflat.Profiles.MediaProfile do sponsorblock_categories shorts_behaviour livestream_behaviour + audio_lang preferred_resolution media_container redownload_delay_days @@ -65,6 +66,7 @@ defmodule Pinchflat.Profiles.MediaProfile do # See `build_format_clauses` in the Media context for more. field :shorts_behaviour, Ecto.Enum, values: ~w(include exclude only)a, default: :include field :livestream_behaviour, Ecto.Enum, values: ~w(include exclude only)a, default: :include + field :audio_lang, :string field :preferred_resolution, Ecto.Enum, values: ~w(4320p 2160p 1080p 720p 480p 360p audio)a, default: :"1080p" field :media_container, :string, default: nil diff --git a/priv/repo/erd.png b/priv/repo/erd.png index 6237757..cb4dc3c 100644 Binary files a/priv/repo/erd.png and b/priv/repo/erd.png differ diff --git a/priv/repo/migrations/20241127172054_add_audio_lang_to_media_profiles.exs b/priv/repo/migrations/20241127172054_add_audio_lang_to_media_profiles.exs new file mode 100644 index 0000000..9c6607e --- /dev/null +++ b/priv/repo/migrations/20241127172054_add_audio_lang_to_media_profiles.exs @@ -0,0 +1,9 @@ +defmodule Pinchflat.Repo.Migrations.AddAudioLangToMediaProfiles do + use Ecto.Migration + + def change do + alter table(:media_profiles) do + add :audio_lang, :string + end + end +end