feat: Complete clean TV NFO processing implementation v2.0.0
Local Docker Build (Dev) / build-dev (push) Successful in 17s
Local Docker Build (Dev) / build-dev (push) Successful in 17s
- New EpisodeNFOManager class with video filename matching - NFO files now match video filenames instead of S01E01.nfo format - Clean TVSeriesProcessor with proper Sonarr API integration - Proper date lookup: database -> Sonarr import history -> airdate fallback - Updated manual scan endpoint to use new clean processor - Removed all migration logic and nfo_migration_required sources This is a complete rewrite of TV episode processing with focus on: 1. NFO filenames matching video files 2. Proper dateadded field population from Sonarr 3. Clean separation of concerns 4. Robust fallback logic
This commit is contained in:
+14
-3
@@ -30,6 +30,7 @@ from core.path_mapper import PathMapper
|
||||
from clients.radarr_client import RadarrClient
|
||||
from clients.sonarr_client import SonarrClient
|
||||
from clients.external_clients import ExternalClientManager
|
||||
from processors.tv_series_processor import TVSeriesProcessor
|
||||
|
||||
# ---------------------------
|
||||
# Configuration & Logging
|
||||
@@ -1725,7 +1726,17 @@ start_time = datetime.now(timezone.utc)
|
||||
db = NFOGuardDatabase(config.db_path)
|
||||
nfo_manager = NFOManager(config.manager_brand, config.debug)
|
||||
path_mapper = PathMapper(config) # FIXED: Pass config to PathMapper
|
||||
tv_processor = TVProcessor(db, nfo_manager, path_mapper)
|
||||
|
||||
# Initialize Sonarr client
|
||||
sonarr = SonarrClient(
|
||||
base_url=config.sonarr_url,
|
||||
api_key=config.sonarr_api_key,
|
||||
webhook_secret=config.sonarr_webhook_secret,
|
||||
enabled=config.sonarr_enabled
|
||||
)
|
||||
|
||||
# Use new clean TV processor
|
||||
tv_processor = TVSeriesProcessor(db, nfo_manager, path_mapper, sonarr)
|
||||
movie_processor = MovieProcessor(db, nfo_manager, path_mapper)
|
||||
batcher = WebhookBatcher(nfo_manager)
|
||||
|
||||
@@ -2199,11 +2210,11 @@ async def manual_scan(background_tasks: BackgroundTasks, path: Optional[str] = N
|
||||
except Exception as e:
|
||||
_log("ERROR", f"Failed processing episode {scan_path}: {e}")
|
||||
else:
|
||||
# Full series processing
|
||||
# Full series processing with new clean processor
|
||||
for item in scan_path.iterdir():
|
||||
if item.is_dir() and nfo_manager.parse_imdb_from_path(item):
|
||||
try:
|
||||
tv_processor.process_series(item)
|
||||
tv_processor.process_series_manual_scan(item)
|
||||
except Exception as e:
|
||||
_log("ERROR", f"Failed processing TV series {item}: {e}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user