[Enhancement] Add option for a source to only use cookies when needed (#640)
* Updated model with new attribute * Update app logic to use new cookie logic * lots of tests * Updated UI and renamed attribute * Updated tests
This commit is contained in:
@@ -27,6 +27,14 @@ defmodule PinchflatWeb.Sources.SourceHTML do
|
||||
]
|
||||
end
|
||||
|
||||
def friendly_cookie_behaviours do
|
||||
[
|
||||
{"Disabled", :disabled},
|
||||
{"When Needed", :when_needed},
|
||||
{"All Operations", :all_operations}
|
||||
]
|
||||
end
|
||||
|
||||
def cutoff_date_presets do
|
||||
[
|
||||
{"7 days", compute_date_offset(7)},
|
||||
|
||||
@@ -87,10 +87,11 @@
|
||||
/>
|
||||
|
||||
<.input
|
||||
field={f[:use_cookies]}
|
||||
type="toggle"
|
||||
label="Use Cookies for Downloading"
|
||||
help="Uses your YouTube cookies for this source (if configured). Used for downloading private playlists and videos. See docs for important details"
|
||||
field={f[:cookie_behaviour]}
|
||||
options={friendly_cookie_behaviours()}
|
||||
type="select"
|
||||
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">
|
||||
|
||||
Reference in New Issue
Block a user