Commit Graph

56 Commits

Author SHA1 Message Date
EstrellaXD
0c8ebb70a3 fix(error-handling): replace bare except clauses with specific exceptions
- qb_downloader.py: catch httpx network errors in logout() and rename_file()
- user.py: log exception details when querying users table fails
- download_client.py: log exception when category creation fails
- title_parser.py: catch specific exceptions (ValueError, AttributeError, TypeError)
  instead of broad Exception in raw_parser()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 14:51:44 +01:00
EstrellaXD
d6e89f62ed perf(database): optimize N+1 queries and add caching
- Replace N individual _is_duplicate() calls with single batch SELECT query
  in add_all() method, reducing database round-trips
- Replace O(n*m) nested loop in match_list() with compiled regex alternation
  pattern for faster torrent-to-bangumi matching
- Add LRU cache (512 entries) to torrent_parser() to avoid redundant regex
  parsing for the same torrent paths
- Extend bangumi search_all() cache TTL from 60s to 300s (5 minutes)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 14:30:16 +01:00
EstrellaXD
3c71cf813f fix(offset): only suggest episode_offset for virtual seasons
- Change episode_offset type from int to int | None
- Only set episode_offset when virtual season split is detected
- For simple season mismatches (e.g., RSS S2 → TMDB S1), episode_offset is now None
- Improve reason messages to clarify when episode offset is/isn't needed
- Update database migration version to 7 and add migration check

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 13:51:55 +01:00
XYenon
3695452fb7 Fix parser (#877)
Thanks for the fix! The improved regex pattern will help parse more anime titles correctly. Closes #876 and #924. 🎉
2026-01-25 22:12:43 +01:00
Leohearts
61c071e035 [fix] better json parsing in openai.py (#913)
Thanks for the contribution\! This fix helps users who use alternative GPT APIs like Moonshot that don't support structured output mode. 🎉
2026-01-25 22:12:38 +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
55b15ea8fe feat: add bangumi archive and episode offset features (#958)
* feat: add bangumi archive and episode offset features

Archive Feature:
- Add archived field to Bangumi model with database migration (v4)
- Add archive/unarchive API endpoints (PATCH /bangumi/archive/{id})
- Add auto-archive for ended series via TMDB metadata refresh
- Add collapsible archived section in UI with visual styling
- Add archive/unarchive button in edit rule popup

Episode Offset Feature:
- Extract series_status and season_episode_counts from TMDB API
- Add suggest-offset API endpoint with auto-detection logic
- Apply offset in renamer gen_path() for episode numbering
- Add offset field with "Auto Detect" button in rule editor
- Look up offset from database when renaming files

The offset auto-detection calculates the sum of episodes from all
previous seasons (e.g., if S01 has 13 episodes, S02E18 → S02E05
with offset=-13).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: add changelog for bangumi archive and episode offset features

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:13:49 +01:00
Estrella Pan
cba4988e52 perf: comprehensive performance optimization for backend and frontend
Backend: shared HTTP connection pool, concurrent RSS/torrent/notification
operations, TMDB/Mikan result caching, database indexes, pre-compiled
regex, __slots__ on dataclasses, O(1) set-based dedup, frozenset lookups,
batch RSS enable/disable, asyncio.to_thread for blocking calls.

Frontend: shallowRef for large arrays, computed table columns, watch
instead of watchEffect, scoped style fix, typed emits, noImplicitAny,
useIntervalFn lifecycle management, shared useClipboard instance,
shallow clone for shared template objects.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 20:46:45 +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
2a757e8f2c feat: add calendar view with Bangumi.tv schedule integration
Add weekly broadcast schedule page showing subscribed anime grouped by
day-of-week. Backend fetches air_weekday from Bangumi.tv calendar API
and matches titles. Frontend displays responsive grid (desktop) and
vertical list (mobile). Edit popup moved to parent layout to fix
KeepAlive conflicts, and restyled with purple theme.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 17:51:19 +01:00
EstrellaXD
c7f793a9f6 fix: secure problem, openai.py 2026-01-23 14:57:00 +01:00
EstrellaXD
d5b84b9085 fix: test openai problem. 2024-09-23 18:09:16 +08:00
KotaHv
f61ff16e91 fix: support episode as int or float 2024-09-15 11:06:21 +08:00
KotaHv
bbb19b3002 fix: Resolve issue #805 2024-09-15 11:06:21 +08:00
Jeremy-Hibiki
89f0754d69 fix: fix multi-line title post-processing in raw_parser
close #679, #794
related pr #685
2024-07-14 17:47:41 +08:00
Estrella Pan
5c1c5e2ebe Merge pull request #676 from KotaHv/fix-subtitles
fix: subtitle file rename failure in collection
2024-04-12 12:10:41 +08:00
KotaHv
690335c4ef fix: Resolve issue #679 2024-02-01 10:33:19 +08:00
KotaHv
3fb6cf6a2e fix: subtitle file rename failure in collection 2024-01-24 22:26:31 +08:00
EstrellaXD
df0292672c fix: mikan poster problem. 2024-01-09 15:25:16 +08:00
EstrellaXD
9521686c3b fix: mikan official title encode problem. 2023-10-12 11:38:02 +08:00
EstrellaXD
f5d8790454 change: remove season info in mikan parser. 2023-10-11 16:16:48 +08:00
100gle
c7c4187807 chore: simplify dict typing 2023-10-08 19:11:13 +08:00
100gle
94a32b3af3 feat(openai): support azure openai 2023-10-08 16:15:16 +08:00
100gle
9b673e3f48 bugfix(openai): replace event loop with ThreadPoolExecutor 2023-10-08 14:05:43 +08:00
EstrellaXD
b63a08a5b3 fix: parser error. 2023-10-05 15:02:35 +08:00
EstrellaXD
0f0f49e506 fix: test. 2023-10-04 17:07:20 +08:00
EstrellaXD
58e84812d0 Fix: test. 2023-10-04 17:01:39 +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
100gle
f2db6542ad chore: move openai module to analyser module 2023-10-01 20:59:09 +08:00
100gle
2751bcabb2 refactor: flatten openai configuration options 2023-10-01 13:00:05 +08:00
100gle
74bdcb915f chore: remove unused print 2023-10-01 09:39:01 +08:00
100gle
3f517c4d2d feat: integrate OpenAIParserto TitleParser 2023-09-30 19:42:31 +08:00
100gle
d093fdba0e chore: add deserializing argument for parse method 2023-09-30 19:31:34 +08:00
100gle
03304baea6 feat: add openai configuration to web ui 2023-09-28 09:08:17 +08:00
100gle
9f834ecefc chore: update docs and use logger instance 2023-09-27 20:40:18 +08:00
100gle
77201d5de2 chore: adjust default parameters and test assertion 2023-09-27 17:01:14 +08:00
100gle
8477774b62 feat: add basic OpenAI parser implementation 2023-09-27 16:53:34 +08:00
EstrellaXD
a5f9f858bc fix: collector season limit 2023-09-25 19:14:07 +08:00
EstrellaXD
3a2c84af98 fix: tmdb parser problem. 2023-09-24 15:51:56 +08:00
shininome
94fbe24bb0 按照时间排序季 2023-09-24 09:47:42 +08:00
EstrellaXD
6a73d9ec41 fix: user update issue, tmdb leak poster issue. 2023-09-23 22:32:57 +08:00
EstrellaXD
9953a76a39 webui: change v-bind model. add transition effect in mian page. 2023-09-07 01:57:19 +08:00
EstrellaXD
aeac217138 fix: version update. rss add bugs. 2023-09-06 23:49:20 +08:00
EstrellaXD
2e4cf0d621 feat: add tmdb poster. 2023-09-06 23:48:39 +08:00
EstrellaXD
ce8baff938 fix: rss api bug. fix ui. 2023-08-29 21:27:18 +08:00
EstrellaXD
cb7aef19c4 fix: test 2023-08-12 15:50:13 +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
d768299c7f fix: fix bugs. 2023-08-06 16:04:38 +08:00
estrella
9b99e6c591 test: add mock test to database. 2023-07-31 16:00:54 +08:00