From c39089fce41d658509edfa7ea859ec884e09102b Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Tue, 10 Mar 2026 18:59:12 -0400 Subject: [PATCH] [+] Detect mislabeled movies --- detect_anomalies.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/detect_anomalies.py b/detect_anomalies.py index 5f50aeb..d51a4af 100644 --- a/detect_anomalies.py +++ b/detect_anomalies.py @@ -72,6 +72,26 @@ def detect_anomalies(): print("No local folder anomalies found.") else: print(f"Download directory {DEFAULT_DL_DIR} does not exist.") + + print(f"\n=== Anomaly 3: TV series with < 6 episodes (Possible Movies) ===") + tv_path = Path(DEFAULT_JELLYFIN_DIR) / "TV" + short_series = [] + video_exts = {".mkv", ".mp4", ".avi", ".ts", ".m2ts", ".webm"} + + if tv_path.exists(): + for series_dir in tv_path.iterdir(): + if series_dir.is_dir(): + video_count = sum(1 for p in series_dir.rglob('*') if p.is_file() and p.suffix.lower() in video_exts) + if 0 < video_count < 6: + short_series.append((series_dir.name, video_count)) + + if short_series: + for name, count in short_series: + print(f"Warning: TV series '{name}' has only {count} video file(s).") + else: + print("No short TV series anomalies found.") + else: + print(f"TV directory {tv_path} does not exist.") if __name__ == "__main__": detect_anomalies()