Download images for sources (#96)

* [WIP] hooked up photo downloading to source metadata worker

* Added new attributes for source images

* Added option to profile form
This commit is contained in:
Kieran
2024-03-19 13:34:01 -07:00
committed by GitHub
parent 8491f8b317
commit 70dd95211f
32 changed files with 584 additions and 18 deletions
@@ -34,6 +34,19 @@ defmodule Pinchflat.Filesystem.FilesystemHelpers do
File.write!(filepath, content, modes)
end
@doc """
Copies a file from source to destination, creating directories as needed.
Returns :ok | raises on error
"""
def cp_p!(source, destination) do
destination
|> Path.dirname()
|> File.mkdir_p!()
File.cp!(source, destination)
end
@doc """
Fetches the file size of a media item and saves it to the database.