Ensure channel detail lookup doesn't download the video - oops

This commit is contained in:
Kieran Eglin 2024-02-01 20:05:49 -08:00
parent d25e65f822
commit 9e17b4aa6a
No known key found for this signature in database
GPG key ID: 193984967FCF432D
3 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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, "{}"}

View file

@ -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\"}"}