Added download cutoff date to sources

This commit is contained in:
Kieran Eglin 2024-03-10 20:35:47 -07:00
parent 404d6feb99
commit d526efe35b
No known key found for this signature in database
GPG key ID: 193984967FCF432D
3 changed files with 20 additions and 2 deletions

View file

@ -21,6 +21,7 @@ defmodule Pinchflat.Sources.Source do
download_media
last_indexed_at
original_url
download_cutoff_date
media_profile_id
)a
@ -45,8 +46,8 @@ defmodule Pinchflat.Sources.Source do
field :fast_index, :boolean, default: false
field :download_media, :boolean, default: true
field :last_indexed_at, :utc_datetime
# This should only be used for user reference going forward
# as the collection_id should be used for all API calls
# Only download media items that were published after this date
field :download_cutoff_date, :date
field :original_url, :string
belongs_to :media_profile, MediaProfile

View file

@ -57,6 +57,14 @@
help="Unchecking still indexes media but it won't be downloaded until you enable this option"
/>
<.input
field={f[:download_cutoff_date]}
type="text"
label="Download Cutoff Date"
placeholder="YYYY-MM-DD"
help="Only download media uploaded after this date. Leave blank to download all media. Must be in YYYY-MM-DD format"
/>
<.button class="my-10 sm:mb-7.5 w-full sm:w-auto">Save Source</.button>
<div class="rounded-sm dark:bg-meta-4 p-4 md:p-6 mb-5">

View file

@ -0,0 +1,9 @@
defmodule Pinchflat.Repo.Migrations.AddDownloadCutoffDateToSources do
use Ecto.Migration
def change do
alter table(:sources) do
add :download_cutoff_date, :date
end
end
end