From 3d7460ad76776c7e61ac53cb3c6beb2d56df0da7 Mon Sep 17 00:00:00 2001 From: SBCrumb Date: Fri, 26 Sep 2025 16:25:08 -0400 Subject: [PATCH] verixon update --- VERSION | 2 +- nfoguard.py | 24 +++++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/VERSION b/VERSION index d6a46de..13cc3a4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.1-preserve-long-nfo-fix-fallback \ No newline at end of file +2.1.2-preserve-long-nfo-fix-scan-logic \ No newline at end of file diff --git a/nfoguard.py b/nfoguard.py index 65db4aa..81bfba2 100644 --- a/nfoguard.py +++ b/nfoguard.py @@ -2059,13 +2059,23 @@ 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 - for item in scan_path.iterdir(): - if item.is_dir() and nfo_manager.parse_imdb_from_path(item): - try: - tv_processor.process_series(item) - except Exception as e: - _log("ERROR", f"Failed processing TV series {item}: {e}") + # Check if this path itself is a series (has IMDb ID in the directory name) + if nfo_manager.parse_imdb_from_path(scan_path): + try: + tv_processor.process_series(scan_path) + except Exception as e: + _log("ERROR", f"Failed processing TV series {scan_path}: {e}") + else: + # Full series processing - scan subdirectories + for item in scan_path.iterdir(): + if (item.is_dir() and + not item.name.lower().startswith('season') and + not re.match(r'^season\s+\d+$', item.name, re.IGNORECASE) and + nfo_manager.parse_imdb_from_path(item)): + try: + tv_processor.process_series(item) + except Exception as e: + _log("ERROR", f"Failed processing TV series {item}: {e}") if scan_type in ["both", "movies"] and scan_path in config.movie_paths: _log("INFO", f"Scanning movies in: {scan_path}")