From 41bccb82b1fc8c85945b60b75750c7e452d20a3c Mon Sep 17 00:00:00 2001 From: sbcrumb Date: Sun, 12 Oct 2025 10:42:26 -0400 Subject: [PATCH] fix: Correct IMDb ID pattern matching in TV show webhook processing - Fix glob pattern to escape brackets for literal [imdb-ID] matching - Resolves issue where webhook for Girls (2012) [tt1723816] was incorrectly matching Gachiakuta (2025) [tt32612521] - Previous pattern treated brackets as character sets instead of literal strings --- utils/file_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/file_utils.py b/utils/file_utils.py index 205be99..8bce466 100644 --- a/utils/file_utils.py +++ b/utils/file_utils.py @@ -62,7 +62,8 @@ def find_media_path_by_imdb_and_title( # Search by IMDb ID first (more reliable) if imdb_id: - pattern = str(media_path / f"*[imdb-{imdb_id}]*") + # Use proper glob pattern - escape brackets to match literal [imdb-ID] + pattern = str(media_path / f"*\\[imdb-{imdb_id}\\]*") matches = glob.glob(pattern) if matches: return Path(matches[0])