From ce4497bc6394ef3b28c0e00947676cbdec75c18a Mon Sep 17 00:00:00 2001 From: Kieran Eglin Date: Sat, 2 Mar 2024 11:51:41 -0800 Subject: [PATCH] Added new options to default template and UI --- lib/pinchflat/profiles/media_profile.ex | 3 ++- lib/pinchflat/profiles/options/yt_dlp/output_path_builder.ex | 3 +++ .../controllers/media_profiles/media_profile_html.ex | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/pinchflat/profiles/media_profile.ex b/lib/pinchflat/profiles/media_profile.ex index 848eae6..db3f888 100644 --- a/lib/pinchflat/profiles/media_profile.ex +++ b/lib/pinchflat/profiles/media_profile.ex @@ -29,7 +29,8 @@ defmodule Pinchflat.Profiles.MediaProfile do schema "media_profiles" do field :name, :string - field :output_path_template, :string, default: "/{{ channel }}/{{ title }}/{{ title }} [{{ id }}].{{ ext }}" + field :output_path_template, :string, + default: "/{{ source_custom_name }}/{{ title }}/{{ title }} [{{ id }}].{{ ext }}" field :download_subs, :boolean, default: true field :download_auto_subs, :boolean, default: true diff --git a/lib/pinchflat/profiles/options/yt_dlp/output_path_builder.ex b/lib/pinchflat/profiles/options/yt_dlp/output_path_builder.ex index 373aca8..4f76eb2 100644 --- a/lib/pinchflat/profiles/options/yt_dlp/output_path_builder.ex +++ b/lib/pinchflat/profiles/options/yt_dlp/output_path_builder.ex @@ -33,6 +33,9 @@ defmodule Pinchflat.Profiles.Options.YtDlp.OutputPathBuilder do end end + # This isn't the only source for custom options, since they can be passed in my the caller. + # `download_option_builder` is the most likely place for other custom options to be added, + # but if in doubt just search the codebase for `OutputPathBuilder.build`. defp custom_yt_dlp_option_map do %{ # Individual parts of the upload date diff --git a/lib/pinchflat_web/controllers/media_profiles/media_profile_html.ex b/lib/pinchflat_web/controllers/media_profiles/media_profile_html.ex index 41840f0..1cffae9 100644 --- a/lib/pinchflat_web/controllers/media_profiles/media_profile_html.ex +++ b/lib/pinchflat_web/controllers/media_profiles/media_profile_html.ex @@ -30,7 +30,7 @@ defmodule PinchflatWeb.MediaProfiles.MediaProfileHTML do end def custom_output_template_options do - ~w(upload_day upload_month upload_year)a + ~w(upload_day upload_month upload_year source_custom_name source_collection_type)a end def common_output_template_options do