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:
Kieran
2024-03-13 11:31:53 -07:00
committed by GitHub
parent cf59bf99cd
commit 25eb772896
17 changed files with 238 additions and 449 deletions
+15 -2
View File
@@ -15,12 +15,25 @@ defmodule Pinchflat.Filesystem.FilesystemHelpers do
tmpfile_directory = Application.get_env(:pinchflat, :tmpfile_directory)
filepath = Path.join([tmpfile_directory, "#{StringUtils.random_string(64)}.#{type}"])
:ok = File.mkdir_p!(Path.dirname(filepath))
:ok = File.write(filepath, "")
:ok = write_p!(filepath, "")
filepath
end
@doc """
Writes content to a file, creating directories as needed.
Takes the same args as File.write!/3.
Returns :ok | raises on error
"""
def write_p!(filepath, content, modes \\ []) do
filepath
|> Path.dirname()
|> File.mkdir_p!()
File.write!(filepath, content, modes)
end
@doc """
Fetches the file size of a media item and saves it to the database.