Updated UI and renamed attribute

This commit is contained in:
Kieran Eglin 2025-03-05 15:18:28 -08:00
parent 994e281a67
commit cc6b91ba03
No known key found for this signature in database
GPG key ID: 193984967FCF432D
3 changed files with 16 additions and 8 deletions

View file

@ -78,8 +78,7 @@ defmodule Pinchflat.Sources.Source do
field :collection_type, Ecto.Enum, values: [:channel, :playlist] field :collection_type, Ecto.Enum, values: [:channel, :playlist]
field :index_frequency_minutes, :integer, default: 60 * 24 field :index_frequency_minutes, :integer, default: 60 * 24
field :fast_index, :boolean, default: false field :fast_index, :boolean, default: false
# TODO: consider renaming `indexing_only` to something like `when_needed` (but better) field :cookie_behaviour, Ecto.Enum, values: [:disabled, :when_needed, :all_operations], default: :disabled
field :cookie_behaviour, Ecto.Enum, values: [:disabled, :indexing_only, :all_operations], default: :disabled
field :download_media, :boolean, default: true field :download_media, :boolean, default: true
field :last_indexed_at, :utc_datetime field :last_indexed_at, :utc_datetime
# Only download media items that were published after this date # Only download media items that were published after this date

View file

@ -27,6 +27,14 @@ defmodule PinchflatWeb.Sources.SourceHTML do
] ]
end end
def friendly_cookie_behaviours do
[
{"Disabled", :disabled},
{"When Needed", :when_needed},
{"All Operations", :all_operations}
]
end
def cutoff_date_presets do def cutoff_date_presets do
[ [
{"7 days", compute_date_offset(7)}, {"7 days", compute_date_offset(7)},

View file

@ -86,12 +86,13 @@
help="Unchecking still indexes media but it won't be downloaded until you enable this option" help="Unchecking still indexes media but it won't be downloaded until you enable this option"
/> />
<.input <.input
field={f[:use_cookies]} field={f[:cookie_behaviour]}
type="toggle" options={friendly_cookie_behaviours()}
label="Use Cookies for Downloading" type="select"
help="Uses your YouTube cookies for this source (if configured). Used for downloading private playlists and videos. See docs for important details" label="Cookie Behaviour"
/> help="Uses your YouTube cookies for this source (if configured). 'When Needed' tries to minimize cookie usage except for certain indexing and downloading tasks. See docs"
/>
<section x-show="advancedMode"> <section x-show="advancedMode">
<.input <.input