Updated video downloader to use full URL; improved docs (#35)

This commit is contained in:
Kieran
2024-02-22 17:46:08 -08:00
committed by GitHub
parent 927560beb6
commit 3b94b269d9
4 changed files with 22 additions and 17 deletions
+15 -13
View File
@@ -11,19 +11,21 @@ defmodule Pinchflat.Media.MediaItem do
alias Pinchflat.Media.MediaMetadata
alias Pinchflat.Media.MediaItemSearchIndex
@allowed_fields ~w(
title
media_id
description
original_url
livestream
media_downloaded_at
media_filepath
subtitle_filepaths
thumbnail_filepath
metadata_filepath
source_id
)a
@allowed_fields [
# these fields are captured on indexing
:title,
:media_id,
:description,
:original_url,
:livestream,
:source_id,
# these fields are captured on download
:media_downloaded_at,
:media_filepath,
:subtitle_filepaths,
:thumbnail_filepath,
:metadata_filepath
]
@required_fields ~w(title original_url livestream media_id source_id)a
schema "media_items" do
@@ -32,7 +32,7 @@ defmodule Pinchflat.MediaClient.VideoDownloader do
item_with_preloads = Repo.preload(media_item, [:metadata, source: :media_profile])
media_profile = item_with_preloads.source.media_profile
case download_for_media_profile(media_item.media_id, media_profile, backend) do
case download_for_media_profile(media_item.original_url, media_profile, backend) do
{:ok, parsed_json} ->
parser = metadata_parser(backend)