Add support for episode NFO files (#84)
* Added nfo builder for 'episodes' * Added NFO download fields; hooked up NFO generation to downloading pipeline * Added NFO option to media profile
This commit is contained in:
@@ -25,6 +25,7 @@ defmodule Pinchflat.YtDlp.Media do
|
||||
|
||||
alias __MODULE__
|
||||
alias Pinchflat.Utils.FunctionUtils
|
||||
alias Pinchflat.Metadata.MetadataFileHelpers
|
||||
|
||||
@doc """
|
||||
Downloads a single piece of media (and possibly its metadata) directly to its
|
||||
@@ -86,7 +87,7 @@ defmodule Pinchflat.YtDlp.Media do
|
||||
original_url: response["webpage_url"],
|
||||
livestream: response["was_live"],
|
||||
short_form_content: response["webpage_url"] && short_form_content?(response),
|
||||
upload_date: response["upload_date"] && parse_upload_date(response["upload_date"])
|
||||
upload_date: response["upload_date"] && MetadataFileHelpers.parse_upload_date(response["upload_date"])
|
||||
}
|
||||
end
|
||||
|
||||
@@ -106,12 +107,6 @@ defmodule Pinchflat.YtDlp.Media do
|
||||
end
|
||||
end
|
||||
|
||||
defp parse_upload_date(upload_date) do
|
||||
<<year::binary-size(4)>> <> <<month::binary-size(2)>> <> <<day::binary-size(2)>> = upload_date
|
||||
|
||||
Date.from_iso8601!("#{year}-#{month}-#{day}")
|
||||
end
|
||||
|
||||
defp backend_runner do
|
||||
# This approach lets us mock the command for testing
|
||||
Application.get_env(:pinchflat, :yt_dlp_runner)
|
||||
|
||||
Reference in New Issue
Block a user