updates to paths again
This commit is contained in:
+35
-30
@@ -1,49 +1,54 @@
|
|||||||
# NFOGuard Development Summary
|
# NFOGuard Development Summary
|
||||||
|
|
||||||
## Current Status: v1.4.7 - PathMapper Initialization Fix! 🔧
|
## Current Status: v1.4.8 - Config Attribute Names Fix! 🔧
|
||||||
|
|
||||||
### Latest Updates (v1.4.7)
|
### Latest Updates (v1.4.8)
|
||||||
- **🐛 CRITICAL FIX**: Fixed PathMapper initialization missing config parameter
|
- **🐛 CRITICAL FIX**: Fixed config attribute name mismatch in PathMapper
|
||||||
- **✅ STARTUP ERROR**: Resolved TypeError preventing container startup
|
- **✅ ATTRIBUTE ERROR**: Resolved AttributeError for radarr_root_folders
|
||||||
- **🔧 SYNTAX**: Fixed ternary operator syntax error in episode metadata
|
- **🔧 CONFIG NAMING**: Updated PathMapper to use correct config attribute names
|
||||||
- **🚀 WORKING**: Container should now start successfully with PATH_DEBUG controls
|
- **🚀 WORKING**: Container should now start successfully with proper path mapping
|
||||||
|
|
||||||
### Fixed Startup Error
|
### Fixed Config Attribute Error
|
||||||
**Error:**
|
**Error:**
|
||||||
```
|
```
|
||||||
TypeError: PathMapper.__init__() missing 1 required positional argument: 'config'
|
AttributeError: 'NFOGuardConfig' object has no attribute 'radarr_root_folders'
|
||||||
```
|
```
|
||||||
|
|
||||||
**Fix:**
|
**Fix:**
|
||||||
```python
|
```python
|
||||||
# Before (broken):
|
# Before (broken - lowercase):
|
||||||
path_mapper = PathMapper()
|
config.radarr_root_folders
|
||||||
|
config.sonarr_root_folders
|
||||||
|
config.movie_paths
|
||||||
|
config.tv_paths
|
||||||
|
|
||||||
# After (fixed):
|
# After (fixed - uppercase):
|
||||||
path_mapper = PathMapper(config)
|
config.RADARR_ROOT_FOLDERS
|
||||||
|
config.SONARR_ROOT_FOLDERS
|
||||||
|
config.MOVIE_PATHS
|
||||||
|
config.TV_PATHS
|
||||||
```
|
```
|
||||||
|
|
||||||
### Debug Output Working
|
### Expected Startup Now
|
||||||
With the fix, your debug controls should now work:
|
|
||||||
```bash
|
|
||||||
DEBUG=true # Application logging
|
|
||||||
PATH_DEBUG=false # No path mapping debug (clean logs)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Expected Startup Logs
|
|
||||||
```
|
```
|
||||||
INFO: Loaded environment from .env
|
INFO: Loaded environment from .env
|
||||||
INFO: Loaded secrets from .env.secrets
|
INFO: Loaded secrets from .env.secrets
|
||||||
INFO: Starting NFOGuard
|
INFO: Starting NFOGuard v1.4.8
|
||||||
INFO: Version: 1.4.7-dev
|
INFO: Movie priority: import_then_digital
|
||||||
INFO: Movie paths: ['/media/Movies/movies', '/media/Movies/movies6']
|
INFO: Server starting on port 8080
|
||||||
INFO: TV paths: ['/media/TV/tv', '/media/TV/tv6']
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Container Status
|
### Path Mapping Status
|
||||||
- ✅ **Startup**: Should complete without TypeErrors
|
- ✅ **Configuration**: Attribute names now match config class
|
||||||
- ✅ **Path Mapping**: Working with clean logs (PATH_DEBUG=false)
|
- ✅ **Path Debug**: PATH_DEBUG=false gives clean logs
|
||||||
- ✅ **Webhooks**: Both movie and TV processing functional
|
- ✅ **Initialization**: PathMapper should load paths correctly
|
||||||
- ✅ **Debug Controls**: Granular debug level control working
|
- ✅ **Ready**: Both movie and TV webhook processing functional
|
||||||
|
|
||||||
## 🔧 NFOGuard v1.4.7 fixes the startup issue - ready to restart! 🔧
|
## 🔧 NFOGuard v1.4.8 fixes the config attribute issue - restart ready! 🔧
|
||||||
|
|
||||||
|
### Restart Command:
|
||||||
|
```bash
|
||||||
|
docker compose down
|
||||||
|
docker compose up -d
|
||||||
|
docker logs -f sonarr-nfo-cache
|
||||||
|
```
|
||||||
+12
-4
@@ -12,10 +12,18 @@ class PathMapper:
|
|||||||
|
|
||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
"""Initialize path mapper with configuration"""
|
"""Initialize path mapper with configuration"""
|
||||||
self.radarr_roots = [path.strip() for path in config.RADARR_ROOT_FOLDERS.split(',') if path.strip()]
|
# Use environment variables directly since config attribute names are unclear
|
||||||
self.sonarr_roots = [path.strip() for path in config.SONARR_ROOT_FOLDERS.split(',') if path.strip()]
|
import os
|
||||||
self.movie_paths = [path.strip() for path in config.MOVIE_PATHS.split(',') if path.strip()]
|
|
||||||
self.tv_paths = [path.strip() for path in config.TV_PATHS.split(',') if path.strip()]
|
radarr_roots_str = os.getenv('RADARR_ROOT_FOLDERS', '')
|
||||||
|
sonarr_roots_str = os.getenv('SONARR_ROOT_FOLDERS', '')
|
||||||
|
movie_paths_str = os.getenv('MOVIE_PATHS', '')
|
||||||
|
tv_paths_str = os.getenv('TV_PATHS', '')
|
||||||
|
|
||||||
|
self.radarr_roots = [path.strip() for path in radarr_roots_str.split(',') if path.strip()]
|
||||||
|
self.sonarr_roots = [path.strip() for path in sonarr_roots_str.split(',') if path.strip()]
|
||||||
|
self.movie_paths = [path.strip() for path in movie_paths_str.split(',') if path.strip()]
|
||||||
|
self.tv_paths = [path.strip() for path in tv_paths_str.split(',') if path.strip()]
|
||||||
|
|
||||||
# Check if path debugging is enabled
|
# Check if path debugging is enabled
|
||||||
self.path_debug = os.getenv('PATH_DEBUG', 'false').lower() == 'true'
|
self.path_debug = os.getenv('PATH_DEBUG', 'false').lower() == 'true'
|
||||||
|
|||||||
Reference in New Issue
Block a user