Commit Graph

22 Commits

Author SHA1 Message Date
Estrella Pan
ec4aca5aba fix(core): improve program lifecycle and background task management
- Use per-task stop events instead of shared stop_event to prevent
  stopping one task from killing all others
- Track running state via _tasks_started flag instead of stop_event
- Add error handling in RSS, rename, scan, and calendar loops
- Make restart() resilient to stop failures (catch and continue)
- Cache downloader status check with 60s TTL
- Fix _startup_done set before start() completes (race condition)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:46:22 +01:00
Estrella Pan
b33ec01363 fix: improve rename reliability and add torrent tagging API
- Fix qBittorrent rename verification (verify file actually renamed)
- Add pending rename cooldown to prevent spam when rename delayed
- Add torrent tagging API for accurate offset lookup
- Add auto calendar refresh every 24 hours
- Fix frontend error handling (don't logout on server errors)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 20:54:04 +01:00
Estrella Pan
12ac30c76a fix(core): prevent duplicate startup logo from nested router lifespan events
FastAPI's merged_lifespan mechanism triggers lifespan events for each
nested router layer. Since program_router is included in v1, which is
included in app, the startup handler was being called 3 times.

Added _startup_done flag to ensure Program.startup() only executes once.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-01-26 07:28:48 +01:00
Estrella Pan
66c7127f21 feat(offset): add automatic season/episode offset detection
- Add offset detector to identify season mismatches between RSS and TMDB
- Only suggest season_offset (user sets episode_offset manually)
- Add background scanner for existing bangumi rules
- Add detect-offset and dismiss-review API endpoints
- Add warning banner in edit dialog with auto-detect button
- Add iOS-style notification badge for needs_review items
- Yellow badge with "!" for warnings, purple badge for multi-rule count
- Combined badge shows "! | 2" when both conditions apply
- Yellow glow animation on cards needing review
- Highlight warning items in rule selection popup

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 21:03:18 +01:00
Estrella Pan
683e272b4d fix(core): add max retry for downloader connection check
Prevents startup from hanging indefinitely when downloader is
unreachable (e.g., due to proxy configuration). After 10 retries
(~5 min), program continues with an error log instead of blocking.

Fixes #955 (comment)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:58:55 +01:00
Estrella Pan
dcc60ce9a5 fix(db,downloader): fix server error on upgrade from 3.1.x to 3.2.x (#956)
- Fix 'dict' object has no attribute 'files' in renamer by using dict
  access for qBittorrent API responses and fetching file lists via
  separate torrents/files endpoint
- Replace version-file-based migration with schema_version table to
  reliably track and apply database migrations on every startup
- Add air_weekday column migration as versioned migration entry
- Add torrents_files method to QbDownloader and Aria2Downloader

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-01-24 18:26:57 +01:00
Estrella Pan
9235b07b41 fix: resolve config conflicts when upgrading from 3.1.x to 3.2
Old 3.1.x config files used different field names (sleep_time/times)
that were silently dropped during loading, causing user settings to
be lost on upgrade. Also fixes version migration dispatch that was
incorrectly calling 3.0→3.1 migration for all upgrades.

- Migrate old config fields: sleep_time→rss_time, times→rename_time
- Remove deprecated rss_parser fields (type, custom_url, token, enable_tmdb)
- Fix ENV_TO_ATTR mapping to use correct model field names
- Sync DEFAULT_SETTINGS with current Config model
- Add version-aware migration dispatch (from_31_to_32)
- Add comprehensive migration tests (config + database)

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-01-24 07:49:23 +01:00
Estrella Pan
a98a162500 feat: fix search, poster serving, and add hover overlay UI for cards
- Fix search store exports to match component expectations (inputValue,
  bangumiList, onSearch) and transform data to SearchResult format
- Fix poster endpoint path check that incorrectly blocked all requests
- Add resolvePosterUrl utility to handle both external URLs and local paths
- Move tags into hover overlay on homepage cards and calendar cards
- Show title and tags on poster hover with dark semi-transparent styling
- Add downloader API, store, and page
- Update backend to async patterns and uv migration changes
- Remove .claude/settings.local.json from tracking

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 21:20:12 +01:00
EstrellaXD
d2cfd9b150 feat: add WebAuthn passkey authentication support
- Add passkey login as alternative authentication method
- Support multiple passkeys per user with custom names
- Backend: WebAuthn service, auth strategy pattern, API endpoints
- Frontend: passkey management UI in settings, login option
- Fix: convert downloader check from sync requests to async httpx
  to prevent blocking the event loop when downloader unavailable

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 14:57:00 +01:00
Rewrite0
22dfed741e fix: program restart error 2024-09-26 09:15:54 +08:00
EstrellaXD
cbc3f1f91e fix: temp fix ab cannot startup without qb live.
Close #839
2024-09-15 11:22:01 +08:00
EstrellaXD
fb721d25dc feat: add local cache poster. 2023-10-04 16:56:07 +08:00
100gle
3ead13f4b0 chore(format): fix the ruff checking issue 2023-10-02 13:16:31 +08:00
estrella
9fcbb6cc7f fix: program api problem 2023-09-18 19:48:19 +08:00
estrella
ee5a6669e7 fix: 启动时可以剥离 qBittorrent。 2023-09-17 21:45:52 +08:00
EstrellaXD
aeac217138 fix: version update. rss add bugs. 2023-09-06 23:49:20 +08:00
EstrellaXD
8300461155 fix: test, and if database is deleted, recreate database. 2023-08-13 15:43:14 +08:00
EstrellaXD
dd5c918703 change: change rss item database, add more option for split rss link. 2023-08-12 15:40:43 +08:00
EstrellaXD
1c4e8dc293 fix: old data support problem. 2023-08-07 20:14:45 +08:00
EstrellaXD
4d2c4b80a7 fix: fix bugs. Remove unnecessary code. 2023-08-06 17:01:46 +08:00
100gle
e336fd7402 chore: style with black 2023-06-13 22:15:52 +08:00
zthxxx
069a86faa0 chore: move Auto_Bangumi/src -> Auto_Bangumi/backend/src, prepare for merge WebUI repo 2023-06-06 22:33:00 +08:00