38 Commits

Author SHA1 Message Date
7c56c8bef2 Fix download service init when anime dir not configured 2025-12-02 17:36:41 +01:00
b0f3b643c7 Migrate download queue from JSON to SQLite database
- Created QueueRepository adapter in src/server/services/queue_repository.py
- Refactored DownloadService to use repository pattern instead of JSON
- Updated application startup to initialize download service from database
- Updated all test fixtures to use MockQueueRepository
- All 1104 tests passing
2025-12-02 16:01:25 +01:00
4347057c06 soem fixes 2025-12-02 14:04:37 +01:00
ae77a11782 chore: Complete Task 10 - Final Validation
Task 10: Final Validation - All checks passed
- All 817 unit tests pass
- All 140 integration tests pass
- All 55 API tests pass
- Total: 1012 tests passing

All 10 migration tasks completed:
1.  Create Data File Migration Service
2.  Create Startup Migration Script
3.  Integrate Migration into FastAPI Lifespan
4.  Update SerieList to Use Database
5.  Update SerieScanner to Use Database
6.  Update Anime API Endpoints
7.  Update Dependencies and SeriesApp
8.  Write Integration Tests
9.  Clean Up Legacy Code
10.  Final Validation
2025-12-01 19:58:12 +01:00
396b243d59 chore: Add deprecation warnings and update documentation (Task 9)
Task 9: Clean up legacy code
- Added deprecation warnings to Serie.save_to_file() and load_from_file()
- Updated infrastructure.md with Data Storage section documenting:
  - SQLite database as primary storage
  - Legacy file storage as deprecated
  - Data migration process
- Added deprecation warning tests for Serie class
- Updated existing tests to handle new warnings
- All 1012 tests pass (872 unit + 55 API + 85 integration)
2025-12-01 19:55:15 +01:00
73283dea64 test(integration): Add comprehensive migration integration tests (Task 8)
Task 8: Write integration tests for data file migration
- Added test_migration_on_fresh_start_no_data_files test
- Added test_add_series_saves_to_database test
- Added test_scan_async_saves_to_database test
- Added test_load_series_from_db test
- Added test_search_and_add_workflow test
- All 11 migration integration tests pass
- All 870 tests pass (815 unit + 55 API)
2025-12-01 19:47:19 +01:00
cb014cf547 feat(core): Add database support to SeriesApp (Task 7)
- Added db_session parameter to SeriesApp.__init__()
- Added db_session property and set_db_session() method
- Added init_from_db_async() for async database initialization
- Pass db_session to SerieList and SerieScanner during construction
- Added get_series_app_with_db() dependency for FastAPI endpoints
- All 815 unit tests and 55 API tests pass
2025-12-01 19:42:04 +01:00
338e3feb4a cleanup 2025-11-28 18:58:50 +01:00
a833077f97 Phase 5: Frontend - Use key as primary series identifier
- Updated app.js to use 'key' as primary series identifier
  - selectedSeries Set now uses key instead of folder
  - createSerieCard() uses data-key attribute for identification
  - toggleSerieSelection() uses key for lookups
  - downloadSelected() iterates with key values
  - updateSelectionUI() and toggleSelectAll() use key

- Updated WebSocket service tests
  - Tests now include key and folder in broadcast data
  - Verified both fields are included in messages

- No changes needed for queue.js and other JS files
  - They use download item IDs correctly, not series identifiers

- No template changes needed
  - Series cards rendered dynamically in app.js

All 996 tests passing
2025-11-28 16:18:33 +01:00
5aabad4d13 "Task 4.7: Update template helpers to use key identifier
- Add series context helpers: prepare_series_context, get_series_by_key, filter_series_by_missing_episodes
- Update module docstring with identifier convention documentation
- Add unit tests for new series context helper functions
- Update infrastructure.md with template helpers documentation
- Mark Phase 4 (API Layer) as complete"
2025-11-28 16:01:18 +01:00
da4973829e backup 2025-11-27 19:02:55 +01:00
e42e223f28 refactory instructions 2025-11-23 11:45:34 +01:00
cf503c8d77 fixed empty queu 2025-11-20 18:53:22 +01:00
b1f4d41b27 fix tests 2025-11-19 21:20:22 +01:00
17c7a2e295 fixed tests 2025-11-19 20:46:08 +01:00
7b07e0cfae fixed : tests 2025-11-15 17:55:27 +01:00
fac0cecf90 fixed some tests 2025-11-15 16:56:12 +01:00
f49598d82b fix tests 2025-11-15 12:35:51 +01:00
ec987eff80 chore: make sure that there is only one app 2025-11-02 15:14:34 +01:00
e414a1a358 refactored callback 2025-11-02 10:34:49 +01:00
3c6d82907d queue fix 2025-11-01 15:43:15 +01:00
3be175522f download re implemented 2025-10-30 22:06:41 +01:00
6ebc2ed2ea download instrction 2025-10-30 21:37:00 +01:00
fadd4973da cleanup unused methods 2025-10-30 21:22:43 +01:00
dbb5701660 fix: add to download 2025-10-30 20:44:34 +01:00
55781a8448 remove part 3 2025-10-30 20:20:52 +01:00
fd76be02fd remove part 2 2025-10-30 20:11:38 +01:00
4649cf562d remove part 1 2025-10-30 20:06:45 +01:00
627f8b0cc4 fix download 2025-10-30 19:56:22 +01:00
95b7059576 Fix API tests: update field names and function naming 2025-10-28 19:09:14 +01:00
75aa410f98 fixed: recan issues 2025-10-26 19:14:11 +01:00
a41c86f1da refactor: remove GlobalLogger and migrate to standard Python logging
- Remove src/infrastructure/logging/GlobalLogger.py
- Update SerieScanner.py to use standard logging.getLogger()
- Update aniworld_provider.py to remove custom noKeyFound_logger setup
- Fix test_dependencies.py to properly mock config_service
- Fix code style issues (line length, formatting)
- All 846 tests passing
2025-10-25 17:27:49 +02:00
a3651e0e47 fix: load configuration from config.json and fix authentication
- Load anime_directory and master_password_hash from config.json on startup
- Sync configuration from config.json to settings object in fastapi_app.py
- Update dependencies.py to load config from JSON if not in environment
- Fix app.js to use makeAuthenticatedRequest() for all authenticated API calls
- Fix API endpoint paths from /api/v1/anime to /api/anime
- Update auth_service.py to load master_password_hash from config.json
- Update auth.py setup endpoint to save master_password_hash to config
- Fix rate limiting code to satisfy type checker
- Update config.json with test master password hash

Fixes:
- 401 Unauthorized errors on /api/anime endpoint
- 503 Service Unavailable errors on /api/anime/process/locks
- Configuration not being loaded from config.json file
- Authentication flow now works end-to-end with JWT tokens
2025-10-24 20:55:10 +02:00
4e08d81bb0 websocket fix 2025-10-24 20:10:40 +02:00
d87ec398bb test fixes 2025-10-19 19:57:42 +02:00
7a71715183 backup 2025-10-12 18:05:31 +02:00
57d49bcf78 Fix setup to login redirect issue
- Fix setup.html to use redirect_url from API response instead of hardcoded '/'
- Add database creation (aniworld.db, cache.db) during setup process
- Setup now properly creates all required files for validation
- After setup completion, users are correctly redirected to /login
- Tested: setup API returns correct redirect_url, database files created, redirect works
2025-10-06 13:32:35 +02:00
85f2d2c6f7 cleanup 2 2025-10-05 22:22:04 +02:00