Skip to content

Commit 075577a

Browse files
authored
Handles "None" imdb_id string (Audionut#606)
Prevents errors when the imdb_id string is "None" by converting it to an empty string. This ensures that the subsequent check to convert to integer does not fail, and that the imdb_id is correctly treated as missing.
1 parent 1d86881 commit 075577a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/tmdb.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,8 @@ async def tmdb_other_meta(
441441
runtime = media_data.get('runtime', 60)
442442
if quickie_search or not imdb_id:
443443
imdb_id_str = str(media_data.get('imdb_id', '')).replace('tt', '')
444+
if imdb_id_str == "None":
445+
imdb_id_str = ""
444446
if imdb_id and imdb_id_str and (int(imdb_id_str) != imdb_id):
445447
imdb_mismatch = True
446448
imdb_id = int(imdb_id_str) if imdb_id_str.isdigit() else 0

0 commit comments

Comments
 (0)