Commit Graph

1801 Commits

Author SHA1 Message Date
Estrella Pan
326d31dd0f Merge origin/main into 3.2-dev (resolve version conflict)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 12:55:18 +01:00
Estrella Pan
b1497aa6b1 fix(test): invalidate module-level bangumi cache between tests
The BangumiDatabase.search_all() uses a module-level TTL cache that
persists across tests using different in-memory SQLite databases.
This caused test_migrate_preserves_existing_data and test_migrate_idempotent
to return stale cached results (1 bangumi instead of 2).

Add an autouse fixture in conftest.py to clear the cache before and after
each test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 12:11:28 +01:00
Estrella Pan
eefe85db4b chore: bump version to 3.2.3 and update changelog for release
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 12:06:30 +01:00
Estrella Pan
adf44d140a fix(renamer,rss): preserve episode 0 specials and handle invalid filter regex
- Skip episode offset for episode 0 (specials/OVAs) to prevent overwriting
  regular episodes (fixes #977)
- Catch re.PatternError in RSS filter compilation and fall back to literal
  matching when user filter contains invalid regex chars (fixes #974)
- Remove Aria2 and Transmission from README supported downloaders list
  (addresses #987)
- Add regression tests for issues #974, #976, #977, #986

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 12:03:59 +01:00
Estrella Pan
e82e6ab128 fix(ui): fix auth routing, i18n init, and component lifecycle issues
- useAuth: replace watcher with explicit router.replace on login/logout
- useMyI18n: create single i18n instance at module level (avoid dupes)
- usePasskey: detect WebAuthn support synchronously (no onMounted)
- main.ts: import i18n from hook module instead of calling composable
- ab-add-rss: hoist useApi composables outside functions to avoid
  recreating them on each call
- calendar: prevent duplicate refreshes when already refreshing
- downloader: guard interval polling against stale activation state
- router: only mark setupChecked on successful status check
- log store: stop SSE log updates on logout
- i18n: add missing "edit" translation key (en + zh-CN)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:46:56 +01:00
Estrella Pan
52580d08c8 fix(downloader): improve client interfaces and renamer reliability
- Aria2: add stub methods for full duck-typing compatibility
- MockDownloader: add verify parameter to rename_file signature
- DownloadClient: raise ConnectionError on auth failure
- Path: fallback bangumi_name from torrent_name when path is flat
- Renamer: remove unused check_pool and dead compare_ep_version
- Pass torrent_name to _path_to_bangumi for better name resolution
- Remove check_pool unit test (feature removed)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:46:44 +01:00
Estrella Pan
41298f2f8e fix(backend): improve database migrations, parsers, and network handling
Database:
- Add error handling and per-step version tracking in migrations
- Enable SQLite foreign keys via PRAGMA on connect
- Fix SQLAlchemy .is_(None) usage, add session.merge() for detached
- Batch commit for semantic alias merges
- Quote table/field names in fill-null-defaults SQL
- Guard against empty user data in migration

Parsers:
- TMDB: bounded LRU cache (512), asyncio.gather for parallel season
  fetches, fix season regex \d -> \d+, null-safe year, fix id shadowing
- Raw parser: re.escape() for group/prefix regex, None guard on match
- OpenAI: handle Pydantic model_dump, catch ValueError

Network:
- Null-safe get_html() return
- Error handling per RSS item in mikan parser
- Progressive retry delays (5/15/45/120/300s) with specific exceptions
- Platform detection via sys.platform instead of path heuristic
- Move filter cache to instance variable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:46:35 +01:00
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
c7c709fa66 fix(security): harden auth, JWT, WebAuthn, and API endpoints
- Persist JWT secret to config/.jwt_secret (survives restarts)
- Change active_user from list to dict with timestamps
- Extract username from cookie token instead of list index
- Add SSRF protection (_validate_url) for setup test endpoints
- Mask sensitive config fields (password, api_key, token, secret)
- Add auth guards to notification test endpoints
- Fix path traversal in /posters endpoint using resolved path check
- Add CORS middleware with empty allow_origins
- WebAuthn: add challenge TTL (300s), max capacity (100), cleanup
- Remove hardcoded default password from User model
- Use timezone-aware datetime in passkey models
- Adapt unit tests for active_user dict and cookie-based auth

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:46:12 +01:00
Estrella Pan
339166508b test(e2e): add comprehensive E2E integration test suite
67 tests across 11 phases exercising the full AutoBangumi workflow
against Docker infrastructure (qBittorrent + mock RSS server).
Covers setup wizard, auth, config, RSS CRUD, bangumi, downloader,
program lifecycle, log, search, notification, and credential updates
with both happy paths and error conditions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:44:03 +01:00
Estrella Pan
6cbe7090fe fix(database): clean up torrent records on bangumi deletion
When a bangumi was deleted, its associated Torrent records remained in
the database. This prevented re-downloading the same torrents if the
user re-added the anime, because check_new() deduplicates by URL and
would filter out the orphaned records.

Now delete_rule() removes Torrent records before deleting the Bangumi,
so re-adding the same anime correctly treats those torrents as new.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 09:45:58 +01:00
Estrella Pan
9d4bd48ce5 test(parser): expand coverage for raw, torrent, and path parsers
Add 13 new test cases across three parser test files:
- raw_parser: Chinese 第二季, 2160p resolution, bracketed Season N, multi-group with Chinese punctuation, English-only title
- torrent_parser: EP format, tc/zh-tw subtitle, no-language subtitle (ValidationError), multi-level path, [NNvN] version suffix
- path_parser: season=2/no-offset, large positive offset, offset yielding exactly Season 1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 20:48:53 +01:00
Estrella Pan
fb2dd17c0c feat(mcp): add MCP server for LLM tool integration via SSE
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3.2.3-beta.5
2026-02-22 16:42:39 +01:00
Estrella Pan
ba263e0f69 Merge branch 'claude/inspiring-williams' into 3.2-dev
fix(ui): align notification settings with project design system

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 14:44:22 +01:00
Estrella Pan
b570073000 fix(ui): align notification settings with project design system
Replace non-existent ab-dialog with ab-popup for proper modal behavior,
use ab-button/ab-label components and consistent spacing/styles matching
other settings panels (search-provider, proxy).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 14:44:11 +01:00
Estrella Pan
a88e01d3f5 chore: bump version to 3.2.3-beta.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3.2.3-beta.4
2026-02-22 14:11:34 +01:00
Estrella Pan
5f604e94fd perf(logging): optimize logging with rotation, async I/O, and lazy formatting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 14:10:56 +01:00
Estrella Pan
c173454a67 chore: bump version to 3.2.3-beta.3
fix: Episode 0 incorrectly renamed to E01 (#977)
fix: NoneType error in match_list when title_raw is null (#976)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3.2.3-beta.3
2026-01-30 13:13:15 +01:00
Estrella Pan
48bf570697 feat(notification): redesign system to support multiple providers
- Add NotificationProvider base class with send() and test() methods
- Add NotificationManager for handling multiple providers simultaneously
- Add new providers: Discord, Gotify, Pushover, generic Webhook
- Migrate existing providers (Telegram, Bark, Server Chan, WeChat Work) to new architecture
- Add API endpoints for testing providers (/notification/test, /notification/test-config)
- Auto-migrate legacy single-provider configs to new multi-provider format
- Update WebUI with card-based multi-provider settings UI
- Add test button for each provider in settings
- Generic webhook supports template variables: {{title}}, {{season}}, {{episode}}, {{poster_url}}

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 20:58:42 +01:00
Estrella Pan
5eb21bfcfa chore: bump version to 3.2.3-beta.2
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3.2.3-beta.2
2026-01-28 20:27:39 +01:00
Estrella Pan
07093dda8d fix(parser): handle torrent names without brackets in get_group
Fixes IndexError when parsing torrent names that don't follow the
standard [Group] format. Now returns empty string instead of crashing.

Fixes #973

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 20:25:13 +01:00
EstrellaXD
99c8764484 perf: optimize renamer with batch database queries and reduced blocking
- Add batch offset lookup to reduce N database connections to 1-3 per cycle
- Add search_by_qb_hashes() and search_ids() for batch queries
- Throttle pending rename cache cleanup to once per minute max
- Use exponential backoff for rename verification (0.1s->0.2s->0.4s)
- Skip verification for subtitle renames to reduce latency

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 13:55:20 +01:00
Estrella Pan
f4a83d10f8 chore: bump version to 3.2.3-beta.1 3.2.3-beta.1 2026-01-28 08:21:50 +01:00
Estrella Pan
dfe66d279c docs: add Japanese documentation (#970)
Add complete Japanese translation for all documentation pages including:
- Home and about pages
- Deployment guides (Docker CLI, Docker Compose, DSM, Local)
- Configuration pages (RSS, Downloader, Parser, Notifier, Manager, Proxy, Experimental)
- Feature documentation (RSS Management, Bangumi, Calendar, Rename, Search)
- FAQ and troubleshooting
- API reference
- Changelogs (2.6, 3.0, 3.1, 3.2)
- Developer guide

Also updates VitePress config to add Japanese locale with full sidebar navigation.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 21:06:38 +01:00
Estrella Pan
789c02f7f4 fix(docs): convert all relative image paths to absolute paths
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 21:05:05 +01:00
Estrella Pan
d691cb6d80 fix(docs): use absolute paths for images in VitePress
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 21:02:27 +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
7596d041b9 fix(docs): use absolute paths for images (#967)
* fix(docs): use absolute paths for images in public folder

Relative paths (../image/) don't work on Vercel since the image/
folder at docs root is not tracked in git. Only public/image/ is
tracked. Using absolute paths (/image/) correctly references the
public folder assets.

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

* fix: update README image paths to public folder

The images are tracked at docs/public/image/, not docs/image/.

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

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 11:52:50 +01:00
Estrella Pan
93eae80424 Merge pull request #966 from EstrellaXD/3.2-dev
3.2.2
3.2.2
2026-01-27 11:07:35 +01:00
EstrellaXD
b0c00598a5 chore: bump version to 3.2.2 2026-01-27 11:05:36 +01:00
Estrella Pan
76a17fc700 Merge pull request #965 from EstrellaXD/3.2-dev
fix(ci): extract version number from PR title
2026-01-27 11:04:07 +01:00
EstrellaXD
e0cca519b5 fix(ci): extract version number from PR title
The workflow was using the full PR title (e.g., 'Release 3.2.1') as the
version string, causing Docker tags and release creation to fail.

Now extracts just the version number (X.Y.Z or X.Y.Z-suffix) from the
PR title, handling formats like 'Release 3.2.1', 'v3.2.1', or '3.2.1'.
2026-01-27 10:59:21 +01:00
Estrella Pan
48d890a85f Merge pull request #963 from EstrellaXD/3.2-dev
Release 3.2.1
3.2.1
2026-01-27 10:46:01 +01:00
EstrellaXD
418e2b443f Merge origin/main into 3.2-dev 2026-01-27 10:42:54 +01:00
EstrellaXD
f06ed41c0d chore: bump version to 3.2.1 2026-01-27 10:40:35 +01:00
EstrellaXD
f842c53dca fix(docs): move images to public folder for VitePress serving
Images referenced with absolute paths in VitePress frontmatter (e.g.,
/image/icons/rss.png) must be in the public folder to be served correctly.
This fixes missing feature icons on the homepage.

A symlink is created at docs/image -> public/image to maintain compatibility
with relative paths used in markdown files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 10:39:31 +01:00
Estrella Pan
0f01f1dd35 Merge pull request #964 from EstrellaXD/docs/i18n-chinese-default
docs: add i18n support with Chinese as default language
2026-01-27 10:36:50 +01:00
Estrella Pan
03bf265651 docs: add i18n support with Chinese as default language
- Configure VitePress locales with zh-CN as root and en-US as /en/
- Translate all documentation to Chinese (31 files)
- Create English documentation under /en/ directory
- Add Chinese UI labels for navigation and pagination
- Language switcher now available in site header

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-27 07:57:13 +01:00
Estrella Pan
7e9f3a707a fix(renamer): only log rename operations that actually succeed
Previously, the rename log message was printed before checking if the
qBittorrent API call succeeded. This caused log spam when rename
operations failed (e.g., due to 409 conflicts or network errors) since
the same file would be attempted again on the next cycle.

Now the log message is only printed after confirming the rename
succeeded, reducing noise in the logs.

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-27 07:06:18 +01:00
Estrella Pan
24f1f72941 fix(renamer): improve episode offset warning messages (#962)
The warning "Episode offset 0 would result in negative episode" was
misleading and caused log spam. The actual issue was either:
1. Parsed episode was 0 or negative (parsing failure or special episode)
2. A negative offset would make a valid episode negative

Changes:
- Differentiate between parsing issues vs offset issues in log messages
- Use debug level for parsed episode issues (likely special episodes)
- Keep warning level only for actual offset problems
- Include original episode value in warning for better debugging
- Handle edge case where parsed episode is 0 by falling back to 1

Fixes #962

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-27 06:46:14 +01:00
Estrella Pan
3146029d0b fix: add socksio dependency to support SOCKS proxy (#961)
When users have a SOCKS proxy configured (via HTTP_PROXY or ALL_PROXY
environment variables), httpx's AsyncClient automatically tries to use
it but fails without the socksio package installed.

Changed httpx dependency from httpx>=0.25.0 to httpx[socks]>=0.25.0 to
include the socksio package as an extra dependency.

Fixes #961

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-27 06:42:03 +01:00
Estrella Pan
5f3efb0079 Merge pull request #960 from EstrellaXD/docs-update 2026-01-26 23:40:22 +01:00
Estrella Pan
ae129e7764 docs: update 3.2 changelog with beta.11-13 features and add Chinese version
- Added offset detection suggested values display
- Added season offset folder path fix
- Added search panel redesign details (filters, tags, expand/collapse)
- Added mobile UI bugfixes (settings overflow, top bar, search modal, etc.)
- Created Chinese translation of 3.2 changelog

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 23:24:04 +01:00
Estrella Pan
506d1d3f28 docs: add SECURITY.md for vulnerability reporting
Add security policy with bilingual instructions (English/Chinese) for
reporting vulnerabilities via GitHub Private Vulnerability Reporting
or email contact.

Closes #879

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 23:23:35 +01:00
Estrella Pan
5810d5e0ed docs: update README preview image to bangumi-list
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 23:10:57 +01:00
Estrella Pan
bde73e640d docs: update README preview image to bangumi-list
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 23:10:12 +01:00
Estrella Pan
eda98db94a Merge pull request #955 from EstrellaXD/3.2-dev
3.2.0
3.2.0
2026-01-26 21:06:51 +01:00
Estrella Pan
d288994916 fix(test): mock VERSION in setup test to test non-dev config check logic 2026-01-26 21:03:34 +01:00
Estrella Pan
6823c034f0 docs: add changelog for search panel redesign (beta.13) 2026-01-26 21:00:08 +01:00
Estrella Pan
c0480fe028 feat(search): redesign search panel with chip cloud filters
- Add filter section with group, resolution, subtitle, season categories
- Implement multi-select filters with smart disabling for incompatible options
- Display result variant tags as non-clickable colored pills
- Unify tag styling (pill shape, 12px font) across filters and results
- Add expand/collapse for filter categories and variant overflow
- Normalize tag values (resolution: FHD/HD/4K, subtitle: 简/繁/双语)
- Calculate poster height to match 4 rows of variant chips (168px)
- Add click-outside-to-close for modal

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 20:59:28 +01:00