Media downloading indexing options (round 2) (#14)
* Adds options + option builder + metadata parsing for media thumbnails * Added release-type options to media profile; built option parser for indexing operations * Added new media_profile options to creation form; made show helper for rendering database items * Added options for downloading/embedding metadata * Adds option on sources to not download media (index only) * reformatted docs
This commit is contained in:
@@ -10,4 +10,12 @@ defmodule PinchflatWeb.MediaProfiles.MediaProfileHTML do
|
||||
attr :action, :string, required: true
|
||||
|
||||
def media_profile_form(assigns)
|
||||
|
||||
def friendly_format_type_options do
|
||||
[
|
||||
{"Include (default)", :include},
|
||||
{"Exclude", :exclude},
|
||||
{"Only", :only}
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
+25
@@ -4,10 +4,35 @@
|
||||
</.error>
|
||||
<.input field={f[:name]} type="text" label="Name" />
|
||||
<.input field={f[:output_path_template]} type="text" label="Output path template" />
|
||||
|
||||
<h3>Subtitle Options</h3>
|
||||
<.input field={f[:download_subs]} type="checkbox" label="Download Subs" />
|
||||
<.input field={f[:download_auto_subs]} type="checkbox" label="Download Autogenerated Subs" />
|
||||
<.input field={f[:embed_subs]} type="checkbox" label="Embed Subs" />
|
||||
<.input field={f[:sub_langs]} type="text" label="Sub Langs" />
|
||||
|
||||
<h3>Thumbnail Options</h3>
|
||||
<.input field={f[:download_thumbnail]} type="checkbox" label="Download Thumbnail" />
|
||||
<.input field={f[:embed_thumbnail]} type="checkbox" label="Embed Thumbnail" />
|
||||
|
||||
<h3>Metadata Options</h3>
|
||||
<.input field={f[:download_metadata]} type="checkbox" label="Download Metadata" />
|
||||
<.input field={f[:embed_metadata]} type="checkbox" label="Embed Metadata" />
|
||||
|
||||
<h3>Release Format Options</h3>
|
||||
<.input
|
||||
field={f[:shorts_behaviour]}
|
||||
options={friendly_format_type_options()}
|
||||
type="select"
|
||||
label="Include Shorts?"
|
||||
/>
|
||||
<.input
|
||||
field={f[:livestream_behaviour]}
|
||||
options={friendly_format_type_options()}
|
||||
type="select"
|
||||
label="Include Livestreams?"
|
||||
/>
|
||||
|
||||
<:actions>
|
||||
<.button>Save Media profile</.button>
|
||||
</:actions>
|
||||
|
||||
@@ -8,15 +8,6 @@
|
||||
</:actions>
|
||||
</.header>
|
||||
|
||||
<.list>
|
||||
<:item
|
||||
:for={
|
||||
attr <- ~w(name output_path_template download_subs download_auto_subs embed_subs sub_langs)a
|
||||
}
|
||||
title={attr}
|
||||
>
|
||||
<%= Map.get(@media_profile, attr) %>
|
||||
</:item>
|
||||
</.list>
|
||||
<.list_items_from_map map={Map.from_struct(@media_profile)} />
|
||||
|
||||
<.back navigate={~p"/media_profiles"}>Back to media_profiles</.back>
|
||||
|
||||
@@ -8,19 +8,16 @@
|
||||
</:actions>
|
||||
</.header>
|
||||
|
||||
<h3 class="mt-14">Relationships</h3>
|
||||
<.list>
|
||||
<:item title="media_profile">
|
||||
<.link href={~p"/media_profiles/#{@source.media_profile}"}>
|
||||
<%= @source.media_profile.name %>
|
||||
</.link>
|
||||
</:item>
|
||||
|
||||
<:item
|
||||
:for={attr <- ~w(collection_type collection_name collection_id original_url friendly_name)a}
|
||||
title={attr}
|
||||
>
|
||||
<%= Map.get(@source, attr) %>
|
||||
</:item>
|
||||
</.list>
|
||||
|
||||
<h3>Attributes</h3>
|
||||
<.list_items_from_map map={Map.from_struct(@source)} />
|
||||
|
||||
<.back navigate={~p"/media_sources/sources"}>Back to sources</.back>
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
label="Index Frequency"
|
||||
/>
|
||||
|
||||
<.input field={f[:download_media]} type="checkbox" label="Download Media?" />
|
||||
|
||||
<:actions>
|
||||
<.button>Save Source</.button>
|
||||
</:actions>
|
||||
|
||||
Reference in New Issue
Block a user