updates to paths again

This commit is contained in:
2025-09-14 14:23:25 -04:00
parent 1a562f7b41
commit 1dae7df3d2
3 changed files with 48 additions and 35 deletions
+35 -30
View File
@@ -1,49 +1,54 @@
# 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)
- **🐛 CRITICAL FIX**: Fixed PathMapper initialization missing config parameter
- **✅ STARTUP ERROR**: Resolved TypeError preventing container startup
- **🔧 SYNTAX**: Fixed ternary operator syntax error in episode metadata
- **🚀 WORKING**: Container should now start successfully with PATH_DEBUG controls
### Latest Updates (v1.4.8)
- **🐛 CRITICAL FIX**: Fixed config attribute name mismatch in PathMapper
- **✅ ATTRIBUTE ERROR**: Resolved AttributeError for radarr_root_folders
- **🔧 CONFIG NAMING**: Updated PathMapper to use correct config attribute names
- **🚀 WORKING**: Container should now start successfully with proper path mapping
### Fixed Startup Error
### Fixed Config Attribute Error
**Error:**
```
TypeError: PathMapper.__init__() missing 1 required positional argument: 'config'
AttributeError: 'NFOGuardConfig' object has no attribute 'radarr_root_folders'
```
**Fix:**
```python
# Before (broken):
path_mapper = PathMapper()
# Before (broken - lowercase):
config.radarr_root_folders
config.sonarr_root_folders
config.movie_paths
config.tv_paths
# After (fixed):
path_mapper = PathMapper(config)
# After (fixed - uppercase):
config.RADARR_ROOT_FOLDERS
config.SONARR_ROOT_FOLDERS
config.MOVIE_PATHS
config.TV_PATHS
```
### Debug Output Working
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
### Expected Startup Now
```
INFO: Loaded environment from .env
INFO: Loaded secrets from .env.secrets
INFO: Starting NFOGuard
INFO: Version: 1.4.7-dev
INFO: Movie paths: ['/media/Movies/movies', '/media/Movies/movies6']
INFO: TV paths: ['/media/TV/tv', '/media/TV/tv6']
INFO: Starting NFOGuard v1.4.8
INFO: Movie priority: import_then_digital
INFO: Server starting on port 8080
```
### Container Status
-**Startup**: Should complete without TypeErrors
-**Path Mapping**: Working with clean logs (PATH_DEBUG=false)
-**Webhooks**: Both movie and TV processing functional
-**Debug Controls**: Granular debug level control working
### Path Mapping Status
-**Configuration**: Attribute names now match config class
-**Path Debug**: PATH_DEBUG=false gives clean logs
-**Initialization**: PathMapper should load paths correctly
-**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
```
+1 -1
View File
@@ -1 +1 @@
1.4.8
1.4.9
+12 -4
View File
@@ -12,10 +12,18 @@ class PathMapper:
def __init__(self, config):
"""Initialize path mapper with configuration"""
self.radarr_roots = [path.strip() for path in config.RADARR_ROOT_FOLDERS.split(',') if path.strip()]
self.sonarr_roots = [path.strip() for path in config.SONARR_ROOT_FOLDERS.split(',') if path.strip()]
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()]
# Use environment variables directly since config attribute names are unclear
import os
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
self.path_debug = os.getenv('PATH_DEBUG', 'false').lower() == 'true'