accept IMDB IDs for TV episodes too

This commit is contained in:
Ben Goldsworthy 2024-02-25 22:52:06 +01:00
parent bcfaa0e5fb
commit 0663b423bd
Signed by: Rumperuu
SSH key fingerprint: SHA256:e5XfzNOr9UvWpEzyLfw0GtTMZWIFh3NmxH+/qQIi3xE

View file

@ -481,7 +481,7 @@ def cleanup_result(item, media_type) -> dict:
del item[f"original_{title_key}"], item["original_language"] del item[f"original_{title_key}"], item["original_language"]
if "tv-episodes" == media_type: if "tv-episodes" == media_type:
item['series']['tmdb_id'] = item['show_id'] item['series'] = { 'tmdb_id': item['show_id'] }
del item['show_id'] del item['show_id']
if "books" == media_type: if "books" == media_type:
@ -561,8 +561,8 @@ def main() -> None:
elif "tv-episodes" == media_type: elif "tv-episodes" == media_type:
log = "log" log = "log"
while re.search("[0-9]+", item_id) is None: while re.search("(tt)?[0-9]+", item_id) is None:
item_id = input("Enter IMDB ID: ") item_id = input("Enter TVDB or IMDB ID: ")
elif "tv-series" == media_type: elif "tv-series" == media_type:
log = "" log = ""
@ -572,7 +572,7 @@ def main() -> None:
while re.search("[0-9]+", item_id) is None: while re.search("[0-9]+", item_id) is None:
item_id = input("Enter TMDB ID: ") item_id = input("Enter TMDB ID: ")
add_item_to_log(re.search("[0-9]+", item_id)[0], media_type, log) add_item_to_log(re.search("(tt)?[0-9]+", item_id)[0], media_type, log)
except Exception: except Exception:
logger.exception("Exception occurred") logger.exception("Exception occurred")