Source attributes in output template (#45)
* Updated download options to take a media item; allowed for specifying custom output path template options * Fixed bug where indexing job wouldn't run for the first time * Renamed friendly_name to custom_name * Added new options to default template and UI * Improved explainer UI
This commit is contained in:
@@ -30,7 +30,13 @@ defmodule PinchflatWeb.MediaProfiles.MediaProfileHTML do
|
||||
end
|
||||
|
||||
def custom_output_template_options do
|
||||
~w(upload_day upload_month upload_year)a
|
||||
%{
|
||||
upload_day: nil,
|
||||
upload_month: nil,
|
||||
upload_year: nil,
|
||||
source_custom_name: "the name of the sources that use this profile",
|
||||
source_collection_type: "the collection type of the sources that use this profile. Either 'channel' or 'playlist'"
|
||||
}
|
||||
end
|
||||
|
||||
def common_output_template_options do
|
||||
|
||||
+5
-4
@@ -46,8 +46,8 @@
|
||||
</section>
|
||||
|
||||
<h2 class="text-xl font-bold mb-2">Template Options</h2>
|
||||
<section class="ml-2 md:ml-4 mb-4 max-w-prose">
|
||||
<p>
|
||||
<section class="ml-2 md:ml-4 mb-4">
|
||||
<p class="max-w-prose">
|
||||
Any single-word <code class="text-sm">yt-dlp</code>
|
||||
option
|
||||
<.inline_link href="https://github.com/yt-dlp/yt-dlp?tab=readme-ov-file#output-template">
|
||||
@@ -58,8 +58,9 @@
|
||||
</p>
|
||||
<h3 class="text-lg font-bold mb-2">Custom Aliases</h3>
|
||||
<ul class="list-disc list-inside ml-2 md:ml-5">
|
||||
<li :for={opt <- custom_output_template_options()}>
|
||||
<.inline_code>{{ <%= opt %> }}</.inline_code>
|
||||
<li :for={{k, v} <- custom_output_template_options()}>
|
||||
<.inline_code>{{ <%= k %> }}</.inline_code>
|
||||
<span :if={v}>- <%= v %></span>
|
||||
</li>
|
||||
</ul>
|
||||
<h3 class="text-lg font-bold mb-2">Common Options</h3>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<:tab title="Sources">
|
||||
<.table rows={@media_profile.sources} table_class="text-black dark:text-white">
|
||||
<:col :let={source} label="Name">
|
||||
<%= source.friendly_name || source.collection_name %>
|
||||
<%= source.custom_name || source.collection_name %>
|
||||
</:col>
|
||||
<:col :let={source} label="Type"><%= source.collection_type %></:col>
|
||||
<:col :let={source} label="Should Download?">
|
||||
|
||||
Reference in New Issue
Block a user