Commit Graph

13 Commits

Author SHA1 Message Date
EstrellaXD
3f4f3a141c feat(database): add title alias system for mid-season naming changes
When subtitle groups change their naming convention mid-season (e.g.,
"LoliHouse" → "LoliHouse&动漫国"), AutoBangumi was creating duplicate
entries. This adds a title alias system that:

- Detects semantic duplicates (same official_title, dpi, subtitle,
  source, and similar group name)
- Merges them as aliases instead of creating new entries
- Updates match_torrent() and match_list() to check aliases
- Adds title_aliases field to Bangumi model (JSON list)
- Includes migration v8 for the new column
- Adds 10 new tests for the feature
- Fixes cache invalidation bug in disable_rule()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 15:44:44 +01:00
Estrella Pan
bfb94145cb test(renamer): add comprehensive tests for offset lookup functionality
Add tests covering:
- _parse_bangumi_id_from_tags: tag parsing with various formats
- gen_path with offsets: episode/season offset application
- _lookup_offsets: multi-tier lookup (qb_hash, tags, name, path)
- TorrentDatabase hash lookup methods (search_by_qb_hash, search_by_url, update_qb_hash)

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 08:24:23 +01:00
Estrella Pan
b1018d41fe fix(test): use sync sessions in database tests to match production code
The database classes (BangumiDatabase, TorrentDatabase, RSSDatabase) use
synchronous Session, but tests were incorrectly using AsyncSession with
await calls, causing AttributeError on coroutine objects.

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 06:10:20 +01:00
EstrellaXD
9c5474d8e9 feat: migrate backend to uv package manager
Replace pip + requirements.txt with uv for dependency management.

- Multi-stage Dockerfile using ghcr.io/astral-sh/uv builder image
- CI updated to use astral-sh/setup-uv@v4
- Ruff config moved to [tool.ruff.lint] (fixes deprecation)
- Transitive deps removed, missing direct deps added (requests, PySocks, urllib3)
- Database layer migrated to async (AsyncSession + aiosqlite)
- Tests updated to match async database interface

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 12:56:23 +01:00
100gle
3ead13f4b0 chore(format): fix the ruff checking issue 2023-10-02 13:16:31 +08:00
EstrellaXD
94579d6b12 fix: engine bugs 2023-08-06 01:34:59 +08:00
EstrellaXD
f99056c8d6 feat: add test for database and rss engine. 2023-08-05 20:19:06 +08:00
estrella
472a5093e9 refactor: database and rss engine 2023-08-03 14:16:52 +08:00
estrella
c91c79912b chore: remove unnecessary code. fix data search. 2023-07-31 16:17:10 +08:00
estrella
9b99e6c591 test: add mock test to database. 2023-07-31 16:00:54 +08:00
EstrellaXD
643e5d17f8 fix: clean some code. add some config into gitignore. 2023-06-20 20:01:43 +08:00
EstrellaXD
a5611129d6 fix: fix database ci 2023-06-15 15:36:14 +08:00
EstrellaXD
e4d34f0e42 feat: add database test 2023-06-15 14:18:57 +08:00