From f432c10420d1ccbe6b2b869bec313f61979abf06 Mon Sep 17 00:00:00 2001 From: iamkroot Date: Wed, 3 Apr 2024 12:06:41 -0500 Subject: [PATCH] file_info: Cast year and episode number to int If the values are extracted from include_regexes, they might be strs. Fixes #292 --- trakt_scrobbler/file_info.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/trakt_scrobbler/file_info.py b/trakt_scrobbler/file_info.py index 0546b95..0494efe 100644 --- a/trakt_scrobbler/file_info.py +++ b/trakt_scrobbler/file_info.py @@ -165,9 +165,13 @@ def cleanup_guess(guess): notify(msg) return None guess['season'] = int(season) + # if it came from regex, this might be a string + guess['episode'] = int(guess['episode']) req_keys += ['season', 'episode'] if 'year' in guess: + # ensure it is an int + guess['year'] = int(guess['year']) req_keys += ['year'] return {key: guess[key] for key in req_keys}