Download cutoff date for sources (#69)

* Added new uploaded_at column to media items

* Updated indexer to pull upload date

* Updates media item creation to update on conflict

* Added download cutoff date to sources

* Applies cutoff date logic to pending media logic

* Updated docs
This commit is contained in:
Kieran
2024-03-10 21:24:01 -07:00
committed by GitHub
parent c0a11e98d9
commit f60ec4f49d
19 changed files with 304 additions and 68 deletions
+12 -1
View File
@@ -20,6 +20,7 @@ defmodule Pinchflat.Media.MediaItem do
:livestream,
:source_id,
:short_form_content,
:upload_date,
# these fields are captured only on download
:media_downloaded_at,
:media_filepath,
@@ -28,7 +29,16 @@ defmodule Pinchflat.Media.MediaItem do
:thumbnail_filepath,
:metadata_filepath
]
@required_fields ~w(title original_url livestream media_id source_id short_form_content)a
# Pretty much all the fields captured at index are required.
@required_fields ~w(
title
original_url
livestream
media_id
source_id
upload_date
short_form_content
)a
schema "media_items" do
field :title, :string
@@ -38,6 +48,7 @@ defmodule Pinchflat.Media.MediaItem do
field :livestream, :boolean, default: false
field :short_form_content, :boolean, default: false
field :media_downloaded_at, :utc_datetime
field :upload_date, :date
field :media_filepath, :string
field :media_size_bytes, :integer