Updated video downloader to use full URL; improved docs (#35)
This commit is contained in:
@@ -19,7 +19,8 @@ defmodule Pinchflat.MediaClient.VideoDownloaderTest do
|
||||
|
||||
describe "download_for_media_item/3" do
|
||||
test "it calls the backend runner", %{media_item: media_item} do
|
||||
expect(YtDlpRunnerMock, :run, fn _url, _opts, ot ->
|
||||
expect(YtDlpRunnerMock, :run, fn url, _opts, ot ->
|
||||
assert url == media_item.original_url
|
||||
assert ot == "after_move:%()j"
|
||||
|
||||
{:ok, render_metadata(:media_metadata)}
|
||||
|
||||
@@ -10,12 +10,14 @@ defmodule Pinchflat.MediaFixtures do
|
||||
Generate a media_item.
|
||||
"""
|
||||
def media_item_fixture(attrs \\ %{}) do
|
||||
media_id = Faker.String.base64(12)
|
||||
|
||||
{:ok, media_item} =
|
||||
attrs
|
||||
|> Enum.into(%{
|
||||
media_id: Faker.String.base64(12),
|
||||
media_id: media_id,
|
||||
title: Faker.Commerce.product_name(),
|
||||
original_url: "https://www.youtube.com/channel/#{Faker.String.base64(12)}",
|
||||
original_url: "https://www.youtube.com/watch?v=#{media_id}",
|
||||
livestream: false,
|
||||
media_filepath: "/video/#{Faker.File.file_name(:video)}",
|
||||
source_id: SourcesFixtures.source_fixture().id
|
||||
|
||||
Reference in New Issue
Block a user