From 1b41b0e0c76abf947a83f7aec75d9f325b024464 Mon Sep 17 00:00:00 2001 From: Kieran Eglin Date: Wed, 13 Mar 2024 14:19:31 -0700 Subject: [PATCH] Added presets for output templates --- .../downloading/output_path_builder.ex | 4 +- .../components/core_components.ex | 12 +---- .../media_profiles/media_profile_html.ex | 22 ++++++++ .../media_profile_form.html.heex | 51 ++++++++++++++----- 4 files changed, 64 insertions(+), 25 deletions(-) diff --git a/lib/pinchflat/downloading/output_path_builder.ex b/lib/pinchflat/downloading/output_path_builder.ex index 6364da0..374d57f 100644 --- a/lib/pinchflat/downloading/output_path_builder.ex +++ b/lib/pinchflat/downloading/output_path_builder.ex @@ -40,7 +40,9 @@ defmodule Pinchflat.Downloading.OutputPathBuilder do "upload_year" => "%(upload_date>%Y)S", "upload_month" => "%(upload_date>%m)S", "upload_day" => "%(upload_date>%d)S", - "upload_yyyy_mm_dd" => "%(upload_date>%Y-%m-%d)S" + "upload_yyyy_mm_dd" => "%(upload_date>%Y-%m-%d)S", + "season_from_date" => "%(upload_date>%Y)S", + "season_episode_from_date" => "s%(upload_date>%Y)Se%(upload_date>%m%d)S" } end end diff --git a/lib/pinchflat_web/components/core_components.ex b/lib/pinchflat_web/components/core_components.ex index 314dbf9..673b7c9 100644 --- a/lib/pinchflat_web/components/core_components.ex +++ b/lib/pinchflat_web/components/core_components.ex @@ -317,17 +317,7 @@ defmodule PinchflatWeb.CoreComponents do <%= @label_suffix %>
- - +
-

+

General Options

<.input @@ -14,15 +14,40 @@ help="Something descriptive. Does not impact indexing or downloading (required)" /> - <.input - field={f[:output_path_template]} - type="text" - inputclass="font-mono" - label="Output path template" - help="Must end with .{{ ext }}. See below for more details. The default is good for most cases (required)" - /> +

+ Output Path Options +

-

+
+
+ <.input + field={f[:output_path_template]} + type="text" + inputclass="font-mono" + label="Output path template" + help="Must end with .{{ ext }}. See below for more details. The default is good for most cases (required)" + x-model="template" + /> +
+
+ - or - +
+
+ <.input + name="output_path_presets" + value="default" + options={output_template_preset_options()} + type="select" + label="Select preset" + x-on:change="template = event.target.value" + /> +
+
+ +

Subtitle Options

<.input @@ -50,7 +75,7 @@ help="Use commas for multiple languages (eg: en,de)" /> -

+

Thumbnail Options

<.input @@ -66,7 +91,7 @@ help="Downloads and embeds thumbnail in the media file itself, if supported. Uneffected by 'Download Thumbnail' (recommended)" /> -

+

Metadata Options

<.input @@ -88,7 +113,7 @@ help="Downloads NFO data alongside media file for use with Jellyfin, Kodi, etc." /> -

+

Release Format Options

@@ -107,7 +132,7 @@ help="Excludes media that comes from a past livestream" /> -

+

Quality Options