From 9e17b4aa6aba06af5c1554b8fea5984d9d2a5c72 Mon Sep 17 00:00:00 2001 From: Kieran Eglin Date: Thu, 1 Feb 2024 20:05:49 -0800 Subject: [PATCH] Ensure channel detail lookup doesn't download the video - oops --- lib/pinchflat/media_client/backends/yt_dlp/channel.ex | 2 +- test/pinchflat/media_client/backends/yt_dlp/channel_test.exs | 2 +- test/pinchflat/media_client/channel_details_test.exs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pinchflat/media_client/backends/yt_dlp/channel.ex b/lib/pinchflat/media_client/backends/yt_dlp/channel.ex index d97f88d..8df6f6a 100644 --- a/lib/pinchflat/media_client/backends/yt_dlp/channel.ex +++ b/lib/pinchflat/media_client/backends/yt_dlp/channel.ex @@ -16,7 +16,7 @@ defmodule Pinchflat.MediaClient.Backends.YtDlp.Channel do Returns {:ok, %ChannelDetails{}} | {:error, any, ...}. """ def get_channel_details(channel_url) do - opts = [playlist_end: 1] + opts = [:skip_download, playlist_end: 1] with {:ok, output} <- backend_runner().run(channel_url, opts, "%(.{channel,channel_id})j"), {:ok, parsed_json} <- Phoenix.json_library().decode(output) do diff --git a/test/pinchflat/media_client/backends/yt_dlp/channel_test.exs b/test/pinchflat/media_client/backends/yt_dlp/channel_test.exs index 3f9d52f..8fe2dba 100644 --- a/test/pinchflat/media_client/backends/yt_dlp/channel_test.exs +++ b/test/pinchflat/media_client/backends/yt_dlp/channel_test.exs @@ -21,7 +21,7 @@ defmodule Pinchflat.MediaClient.Backends.YtDlp.ChannelTest do test "it passes the expected args to the backend runner" do expect(YtDlpRunnerMock, :run, fn @channel_url, opts, ot -> - assert opts == [playlist_end: 1] + assert opts == [:skip_download, playlist_end: 1] assert ot == "%(.{channel,channel_id})j" {:ok, "{}"} diff --git a/test/pinchflat/media_client/channel_details_test.exs b/test/pinchflat/media_client/channel_details_test.exs index 920fc02..2a98fa5 100644 --- a/test/pinchflat/media_client/channel_details_test.exs +++ b/test/pinchflat/media_client/channel_details_test.exs @@ -18,7 +18,7 @@ defmodule Pinchflat.MediaClient.ChannelDetailsTest do describe "get_channel_details/2" do test "it passes the expected arguments to the backend" do expect(YtDlpRunnerMock, :run, fn @channel_url, opts, ot -> - assert opts == [playlist_end: 1] + assert opts == [:skip_download, playlist_end: 1] assert ot == "%(.{channel,channel_id})j" {:ok, "{\"channel\": \"TheUselessTrials\", \"channel_id\": \"UCQH2\"}"}