mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-09-13 06:07:30 -04:00
Adds three mutually exclusive options to `liberate`: --limit-books, --limit-mb and --limit-gb. Each stops the run once it has downloaded that much, leaving the rest of the library un-liberated for the next run. Requested in #1920: a scripted or scheduled run has no way to take only a slice of a large library, so users resort to feeding the CLI a handful of ASINs at a time. The GUI needs no equivalent, where selecting rows already says exactly which titles to download. Counting reuses the daily limit's history rows rather than a private tally, so a book and a byte mean the same thing to both limits, and failed, cancelled and pdf-only work is never counted. Only titles this run attempted are counted, so a Libation window or a second container downloading at the same time does not consume this run's allowance. The limit is checked before each title rather than at the top of the run, so a run whose books happen to end exactly at the limit reports nothing: nothing was cut short. The daily download limit keeps applying on top, unchanged. Co-authored-by: rmcrackan <rmcrackan@gmail.com>