mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-11-30 18:12:38 +01:00
feat(limit): add opt-in daily download limit core, history store and enforcement
Records every successful audiobook download in the library database (a new DownloadHistory table) and, when the user opts in, stops downloading once the rolling 24 hour window is full. The history lives in the database rather than a file under LibationFiles because in Docker only the database is on a volume; a file there is discarded on every container restart. The limit is checked immediately before each book downloads, never at queueing time, so a full queue stays full and the user can raise or disable the limit mid-run. When nothing in the queue can proceed the queue pauses and re-checks every 15 seconds, recomputing settings, history and clock from scratch, so a queue left running for days drip-feeds itself as downloads age out. The CLI never waits: it skips covered titles and reports a count. Co-authored-by: rmcrackan <rmcrackan@gmail.com>
This commit is contained in:
@@ -141,6 +141,29 @@ public partial class Configuration
|
||||
|
||||
This may take a while, depending on the number of audio files in the folder and the speed of your storage device.
|
||||
""" },
|
||||
{nameof(DailyDownloadLimit), """
|
||||
Stop downloading once you have downloaded this much
|
||||
within the last 24 hours. This is a rolling window,
|
||||
not a calendar day: capacity frees up 24 hours after
|
||||
each download, not at midnight.
|
||||
|
||||
Only downloads that Libation completed successfully
|
||||
are counted. Books you download from the Audible app
|
||||
or website are not counted, because Libation cannot
|
||||
see them.
|
||||
|
||||
"Plus titles only" limits just the Audible Plus
|
||||
catalog titles (the ones with the orange plus badge),
|
||||
which is where Audible is known to throttle heavy
|
||||
use. Titles you own keep downloading.
|
||||
""" },
|
||||
{nameof(DailyDownloadLimitUnit), """
|
||||
MB and GB are approximate. Libation does not know
|
||||
precisely how large an audiobook is before it has
|
||||
been downloaded, so it assumes about 400 MB per book
|
||||
when deciding whether another download would exceed
|
||||
your limit.
|
||||
""" },
|
||||
{nameof(ImportPlusTitles), """
|
||||
When enabled, books from the Audible Plus catalog (titles you stream or borrow under your membership, not purchased) are imported into Libation.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user