Updated other occurance

This commit is contained in:
Kieran Eglin 2024-03-12 12:11:57 -07:00
parent 5bc3a0e09d
commit 3760d45c6d
No known key found for this signature in database
GPG key ID: 193984967FCF432D
2 changed files with 5 additions and 2 deletions

View file

@ -22,7 +22,10 @@ defmodule Pinchflat.YtDlp.MediaCollection do
""" """
def get_media_attributes_for_collection(url, addl_opts \\ []) do def get_media_attributes_for_collection(url, addl_opts \\ []) do
runner = Application.get_env(:pinchflat, :yt_dlp_runner) runner = Application.get_env(:pinchflat, :yt_dlp_runner)
command_opts = [:simulate, :skip_download] # `ignore_no_formats_error` is necessary because yt-dlp will error out if
# the first video has not released yet (ie: is a premier). We don't care about
# available formats since we're just getting the media details
command_opts = [:simulate, :skip_download, :ignore_no_formats_error]
output_template = YtDlpMedia.indexing_output_template() output_template = YtDlpMedia.indexing_output_template()
output_filepath = FilesystemHelpers.generate_metadata_tmpfile(:json) output_filepath = FilesystemHelpers.generate_metadata_tmpfile(:json)
file_listener_handler = Keyword.get(addl_opts, :file_listener_handler, false) file_listener_handler = Keyword.get(addl_opts, :file_listener_handler, false)

View file

@ -22,7 +22,7 @@ defmodule Pinchflat.YtDlp.MediaCollectionTest do
test "it passes the expected default args" do test "it passes the expected default args" do
expect(YtDlpRunnerMock, :run, fn _url, opts, ot, _addl_opts -> expect(YtDlpRunnerMock, :run, fn _url, opts, ot, _addl_opts ->
assert opts == [:simulate, :skip_download] assert opts == [:simulate, :skip_download, :ignore_no_formats_error]
assert ot == Media.indexing_output_template() assert ot == Media.indexing_output_template()
{:ok, ""} {:ok, ""}