From be020410fa70b96a6b28fd6a8a0fc5aad6caba05 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Tue, 10 Mar 2026 19:34:51 -0400 Subject: [PATCH] [+] Detect missing --- detect_anomalies.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/detect_anomalies.py b/detect_anomalies.py index d51a4af..ffbc853 100644 --- a/detect_anomalies.py +++ b/detect_anomalies.py @@ -1,4 +1,5 @@ import re +import argparse from pathlib import Path from utils import DEFAULT_DL_DIR, DEFAULT_JELLYFIN_DIR from utils_qb import get_qb_client @@ -28,7 +29,7 @@ def get_tt_ids_in_jellyfin(jellyfin_dir): return found_ids -def detect_anomalies(): +def detect_anomalies(expected_tt_ids=None): print("Gathering basic info...") jellyfin_tt_ids = get_tt_ids_in_jellyfin(DEFAULT_JELLYFIN_DIR) @@ -92,6 +93,19 @@ def detect_anomalies(): print("No short TV series anomalies found.") else: print(f"TV directory {tv_path} does not exist.") + + if expected_tt_ids: + print(f"\n=== Anomaly 4: Provided IMDb IDs missing from Jellyfin ===") + missing_ids = [tt_id for tt_id in expected_tt_ids if tt_id not in jellyfin_tt_ids] + if missing_ids: + for tt_id in missing_ids: + print(f"Warning: Expected ID '{tt_id}' is not linked in Jellyfin!") + else: + print("All provided IMDb IDs are present in Jellyfin.") if __name__ == "__main__": - detect_anomalies() + parser = argparse.ArgumentParser(description="Find anomalies between torrents, local downloads, and Jellyfin folders.") + parser.add_argument("tt_ids", nargs="*", help="Optional space-separated list of IMDb IDs (e.g., tt1234567 tt7654321) to verify their presence in Jellyfin.") + args = parser.parse_args() + + detect_anomalies(expected_tt_ids=args.tt_ids)