Fix WebSocket room subscription format
This commit is contained in:
BIN
data/.fuse_hidden000049a200000009
Normal file
BIN
data/.fuse_hidden000049a200000009
Normal file
Binary file not shown.
BIN
data/.fuse_hidden000049c60000000a
Normal file
BIN
data/.fuse_hidden000049c60000000a
Normal file
Binary file not shown.
BIN
data/.fuse_hidden000049c700000008
Normal file
BIN
data/.fuse_hidden000049c700000008
Normal file
Binary file not shown.
@@ -124,7 +124,6 @@ For each task completed:
|
||||
1. ✅ **NFO/Artwork Loading Isolation** (Completed: 2026-01-23)
|
||||
- Task: Ensure during anime add, NFO, logo, art, etc. is loaded only for the specific anime being added
|
||||
- Status: VERIFIED - Implementation is correct
|
||||
|
||||
2. ✅ **Setup Redirect Flow** (Completed: 2026-01-23)
|
||||
- Task: Implement redirect flow: setup -> loading -> login when user completes setup
|
||||
- Changes:
|
||||
@@ -132,7 +131,6 @@ For each task completed:
|
||||
- Setup page redirects to loading with initialization in background
|
||||
- Loading page connects to WebSocket for real-time progress
|
||||
- After completion, loading redirects to login
|
||||
|
||||
3. ✅ **Close Setup and Loading Pages** (Completed: 2026-01-23)
|
||||
- Task: Make setup and loading pages unavailable after completion to prevent re-access
|
||||
- Changes:
|
||||
@@ -140,7 +138,6 @@ For each task completed:
|
||||
- Redirect to login if accessing /setup after completion
|
||||
- Check if initialization is complete before allowing access to /loading
|
||||
- Redirect to login if accessing /loading after initialization complete
|
||||
|
||||
4. ✅ **Fix Loading Page WebSocket Auth** (Completed: 2026-01-23)
|
||||
- Task: Fix 403 Forbidden error on WebSocket connection
|
||||
- Issue: Loading page was connecting to /ws/progress (doesn't exist)
|
||||
|
||||
1
docs/key
1
docs/key
@@ -1,3 +1,4 @@
|
||||
API key : 299ae8f630a31bda814263c551361448
|
||||
|
||||
/mnt/server/serien/Serien/
|
||||
|
||||
|
||||
@@ -58,21 +58,25 @@ async def _load_nfo_and_images(self, task: SeriesLoadingTask, db: Any) -> None:
|
||||
### 3. Key Implementation Details
|
||||
|
||||
#### ✅ Isolated Task Processing
|
||||
|
||||
- Each `SeriesLoadingTask` contains data for **exactly one anime**
|
||||
- Tasks are processed sequentially from the queue
|
||||
- No cross-contamination between anime
|
||||
|
||||
#### ✅ Targeted NFO Creation
|
||||
|
||||
- `NFOService.create_tvshow_nfo()` receives parameters for **one anime only**
|
||||
- Downloads poster, logo, fanart to **that anime's folder only**
|
||||
- TMDB API calls are made for **that specific anime's name/year**
|
||||
|
||||
#### ✅ No Global Scanning
|
||||
|
||||
- `SerieList.load_series()` only **checks** for existing files
|
||||
- It does **not** download or create any new files
|
||||
- Used only for initial library scanning, not during anime add
|
||||
|
||||
#### ✅ Isolated Episode Scanning
|
||||
|
||||
- `_load_episodes()` uses `_find_series_directory()` and `_scan_series_episodes()`
|
||||
- Scans **only the specific anime's directory**, not the entire library
|
||||
- No impact on other anime
|
||||
@@ -80,15 +84,19 @@ async def _load_nfo_and_images(self, task: SeriesLoadingTask, db: Any) -> None:
|
||||
## Verification
|
||||
|
||||
### Code Review
|
||||
|
||||
✅ Reviewed implementation in:
|
||||
|
||||
- `src/server/services/background_loader_service.py` (lines 454-544)
|
||||
- `src/server/api/anime.py` (lines 694-920)
|
||||
- `src/core/entities/SerieList.py` (lines 149-250)
|
||||
|
||||
### Test Created
|
||||
|
||||
✅ Created comprehensive test: `tests/integration/test_anime_add_nfo_isolation.py`
|
||||
|
||||
The test verifies:
|
||||
|
||||
1. NFO service called exactly once for new anime
|
||||
2. Correct parameters passed (name, folder, year)
|
||||
3. Existing anime not affected
|
||||
@@ -101,6 +109,7 @@ Note: Test requires database mocking to run fully, but code analysis confirms co
|
||||
**The current implementation is CORRECT and COMPLETE.**
|
||||
|
||||
When adding a new anime:
|
||||
|
||||
- ✅ NFO is created only for that specific anime
|
||||
- ✅ Logo is downloaded only to that anime's folder
|
||||
- ✅ Artwork (poster, fanart) is downloaded only to that anime's folder
|
||||
|
||||
@@ -129,7 +129,9 @@ class SetupRedirectMiddleware(BaseHTTPMiddleware):
|
||||
# Check if initialization is complete
|
||||
try:
|
||||
from src.server.database.connection import get_db_session
|
||||
from src.server.database.system_settings_service import SystemSettingsService
|
||||
from src.server.database.system_settings_service import (
|
||||
SystemSettingsService,
|
||||
)
|
||||
|
||||
async with get_db_session() as db:
|
||||
is_complete = await SystemSettingsService.is_initial_scan_completed(db)
|
||||
|
||||
@@ -305,7 +305,9 @@
|
||||
// Subscribe to system room for progress updates
|
||||
ws.send(JSON.stringify({
|
||||
action: 'join',
|
||||
data: {
|
||||
room: 'system'
|
||||
}
|
||||
}));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user