feat: defer runtime bootstrap and harden watchlist refresh

This commit is contained in:
Dymas
2026-05-14 07:00:48 +02:00
parent 5feee92bcd
commit a6ef93cc95
6 changed files with 2998 additions and 1663 deletions
+46
View File
@@ -1,5 +1,51 @@
# Changelog
## 0.12.0 - 2026-05-13
- Deferred runtime initialization until the server starts or a runtime-backed API/helper is first used, removing the earlier worker/thread startup and state writes from plain module import.
- Persisted watchlist refresh history in SQLite, restore interrupted `pending` and `running` refresh jobs as `interrupted` after restart, and block duplicate queued refresh submissions.
- Hardened thumbnail in-flight event cleanup so unexpected errors during cache updates do not leave later requests waiting on a stuck per-show event.
- Return `400 Bad Request` for non-UTF-8 JSON payloads instead of surfacing them as internal server errors.
- Expanded regression coverage for deferred bootstrap, duplicate refresh protection, interrupted refresh recovery, UTF-8 body validation, and thumbnail event cleanup.
## 0.11.0 - 2026-05-13
- Moved the large inline page templates and shared page-shell helpers into `web_templates.py`, reducing `app.py` to server and runtime logic.
- Changed the shared SQLite file from `queue.sqlite3` to `state.sqlite3` and added automatic migration from the previous project-local database filename.
- Made watchlist poster image routes cache-only so opening the watchlist no longer fans out synchronous remote cover lookups from the browser image tags.
- Moved `Refresh All` onto a background watchlist-refresh worker with status polling so large watchlists no longer block a request thread until every show finishes updating.
- Added an HTTP JSON body-size guard to reject oversized uploads before the server reads unbounded request bodies into memory.
- Reworked the test harness to run against an isolated temporary state root and added handler-level coverage for thumbnail serving, background refresh status, and oversized POST rejection.
## 0.10.0 - 2026-05-13
- Fixed running-job cancellation so the worker now consistently finishes canceled downloads as `canceled` instead of drifting into failed or completed final states.
- Fixed watchlist `Refresh All` to iterate every tracked show instead of silently stopping at the paged list limit.
- Added loopback-only request protection by default, with `ANI_CLI_WEB_ALLOW_REMOTE=1` available when remote/LAN access is intentionally desired.
- Extracted shared sidebar branding and page-link helpers to reduce repeated inline page chrome across Search, Config, and Watchlist.
- Added focused regression tests for cancellation propagation, full watchlist refresh coverage, local-access helpers, and shared template helpers.
## 0.9.0 - 2026-05-13
- Reworked Search, Config, and Watchlist with a Tsuki-inspired visual refresh using violet accents, glassy surfaces, softer gradients, and calmer card styling.
- Kept the existing ani-cli-web behavior and routing intact while unifying the refreshed design language across the whole web UI.
## 0.8.16 - 2026-05-13
- Unified the left sidebar layout across Search, Config, and Watchlist so the page chrome now uses the same panel width, spacing, and structure everywhere.
- Kept the Config page compact by constraining its main settings content while restoring the shared sidebar pattern.
## 0.8.15 - 2026-05-13
- Removed the dependency status panel from the Search page so the main route stays focused on search, episode selection, and queue management.
- Reworked the Config page into a centered compact settings layout instead of the earlier stretched split-screen view.
## 0.8.14 - 2026-05-13
- Added a standalone `/config` page for saved defaults.
- Moved the Search page defaults section onto the new Config page and added Config navigation across Search and Watchlist.
- Kept dependency status visible while moving saved folder, mode, and quality management into the dedicated settings view.
## 0.8.13 - 2026-05-12
- Added a manual thumbnail upload button for watchlist cards that still have no poster, saving the selected image into the local thumbnail cache for that anime.