Streaming media item creation during indexing (#49)

* Implemented streaming during indexing

* Updated file watcher to enqueue download; refactored download worker methods

* Updated File Follower Server timeout
This commit is contained in:
Kieran
2024-03-04 17:14:02 -08:00
committed by GitHub
parent b370c97bfb
commit f55cdc80dd
22 changed files with 613 additions and 98 deletions
+23
View File
@@ -0,0 +1,23 @@
defmodule Pinchflat.Utils.FilesystemUtils do
@moduledoc """
Utility methods for working with the filesystem
"""
alias Pinchflat.Utils.StringUtils
@doc """
Generates a temporary file and returns its path. The file is empty and has the given type.
Generates all the directories in the path if they don't exist.
Returns binary()
"""
def generate_metadata_tmpfile(type) 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, "")
filepath
end
end