pinchflat/lib/pinchflat_web/controllers/media_profiles/media_profile_html.ex
Kieran 09448e3fcc 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
2024-03-02 12:15:10 -08:00

54 lines
1.1 KiB
Elixir

defmodule PinchflatWeb.MediaProfiles.MediaProfileHTML do
use PinchflatWeb, :html
embed_templates "media_profile_html/*"
@doc """
Renders a media_profile form.
"""
attr :changeset, Ecto.Changeset, required: true
attr :action, :string, required: true
def media_profile_form(assigns)
def friendly_format_type_options do
[
{"Include (default)", :include},
{"Exclude", :exclude},
{"Only", :only}
]
end
def friendly_resolution_options do
[
{"2160p", "4k"},
{"1080p", "1080p"},
{"720p", "720p"},
{"480p", "480p"},
{"360p", "360p"}
]
end
def custom_output_template_options do
%{
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
~w(
id
ext
title
fulltitle
uploader
channel
upload_date
duration_string
)a
end
end