Fix get_optional_database_session to handle uninitialized database
- Moved RuntimeError catch to encompass get_db_session() call - Previously only caught during import, not during execution - Now properly yields None when database not initialized - Fixes test_add_series_endpoint_authenticated test failure
This commit is contained in:
@@ -297,15 +297,15 @@ For each task completed:
|
||||
- **What**: Checking for poster.jpg, logo.png, fanart.jpg existence
|
||||
- **Fix**: ✅ Created `src/server/utils/media.py` utility module
|
||||
- **Status**: COMPLETED (January 24, 2026)
|
||||
- **Resolution**:
|
||||
- Created comprehensive media utilities module with functions:
|
||||
- `check_media_files()`: Check existence of standard media files
|
||||
- `get_media_file_paths()`: Get paths to existing media files
|
||||
- `has_all_images()`: Check for complete image set
|
||||
- `count_video_files()` / `has_video_files()`: Video file utilities
|
||||
- Constants: `POSTER_FILENAME`, `LOGO_FILENAME`, `FANART_FILENAME`, `NFO_FILENAME`, `VIDEO_EXTENSIONS`
|
||||
- Updated 7 duplicate locations in `nfo.py` and `background_loader_service.py`
|
||||
- Functions accept both `str` and `Path` for compatibility
|
||||
- **Resolution**:
|
||||
- Created comprehensive media utilities module with functions:
|
||||
- `check_media_files()`: Check existence of standard media files
|
||||
- `get_media_file_paths()`: Get paths to existing media files
|
||||
- `has_all_images()`: Check for complete image set
|
||||
- `count_video_files()` / `has_video_files()`: Video file utilities
|
||||
- Constants: `POSTER_FILENAME`, `LOGO_FILENAME`, `FANART_FILENAME`, `NFO_FILENAME`, `VIDEO_EXTENSIONS`
|
||||
- Updated 7 duplicate locations in `nfo.py` and `background_loader_service.py`
|
||||
- Functions accept both `str` and `Path` for compatibility
|
||||
|
||||
### Further Considerations (Require Architecture Decisions)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user