Fix stale data file updates on download completion
When episodes are downloaded successfully, the in-memory Serie.episodeDict is updated, but the deprecated data file was not being synced. This caused UI to show episodes as missing when already downloaded. Changes: - Update data file in _remove_episode_from_memory when download completes - DB is authoritative; data file is optional backup (deprecated) - Gracefully skip update if data file doesn't exist New integration tests for episode download sync: - Verify episode removed from missing list after download - Verify in-memory cache updated after download - Verify data file updated after download (when it exists) - Verify downloads work without data file
This commit is contained in:
@@ -398,3 +398,29 @@ forward this to `notification_service.notify_download_failed()` so users see
|
||||
a HIGH-priority alert. The loader keeps the failure detail in
|
||||
`logs/download_errors.log` for post-mortem.
|
||||
|
||||
## Series Storage
|
||||
|
||||
### Overview
|
||||
|
||||
Series metadata now stored in the database (SQLAlchemy ORM).
|
||||
Legacy files (`key` and `data` per folder) are deprecated but preserved
|
||||
for backward compatibility.
|
||||
|
||||
### Architecture
|
||||
|
||||
- **Database**: Single source of truth for all series metadata
|
||||
- **In-Memory Cache**: SeriesApp maintains a cache for performance
|
||||
- **Filesystem**: Only used for episode files themselves, not metadata
|
||||
|
||||
### Migration
|
||||
|
||||
First startup after upgrade automatically imports any legacy
|
||||
series files into the database.
|
||||
|
||||
### Legacy Files
|
||||
|
||||
- `key` file: Contains series provider key (deprecated)
|
||||
- `data` file: Contains Serie JSON object (deprecated)
|
||||
|
||||
Both are safe to delete after migration; not needed for normal operation.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user