[Enhancement] Redownload new media after a delay (#173)

* Added redownload-related columns

* Added methods for fetching re-downloadable media items

* Filled out redownload worker + tests

* Added redownload worker to config.exs cron

* Added to UI and README
This commit is contained in:
Kieran
2024-04-10 17:54:45 -07:00
committed by GitHub
parent a2bcd454c7
commit e841f39cf2
15 changed files with 349 additions and 30 deletions
@@ -203,6 +203,17 @@
/>
</section>
<section x-data="{ presets: { default: null, media_center: 1, audio: null, archiving: 1 } }">
<.input
field={f[:redownload_delay_days]}
type="number"
label="Redownload Delay (days)"
min="0"
help="Delay in days until new media is redownloaded. Redownloading new media can improve its quality or SponsorBlock tags. Leave blank to not redownload"
x-init="$watch('selectedPreset', p => p && ($el.value = presets[p]))"
/>
</section>
<h3 class="mt-8 text-2xl text-black dark:text-white">
Media Center Options
</h3>
@@ -63,7 +63,7 @@ defmodule PinchflatWeb.Sources.SourceController do
pending_media =
MediaQuery.new()
|> MediaQuery.for_source(source)
|> MediaQuery.with_media_pending_download()
|> MediaQuery.where_pending_download()
|> order_by(desc: :id)
|> limit(100)
|> Repo.all()