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
This commit is contained in:
2025-10-12 10:42:26 -04:00
parent 0827d30a76
commit 41bccb82b1
+2 -1
View File
@@ -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])