fixed int error

pull/351/head
meisnate12 3 years ago
parent b76b54ade5
commit c2badff8e2

@ -1,6 +1,7 @@
import logging, os, random, sqlite3
from contextlib import closing
from datetime import datetime, timedelta
from modules.util import Failed
logger = logging.getLogger("Plex Meta Manager")
@ -108,7 +109,7 @@ class Cache:
row = cursor.fetchone()
if row:
time_between_insertion = datetime.now() - datetime.strptime(row["expiration_date"], "%Y-%m-%d")
id_to_return = int(row["t_id"])
id_to_return = util.get_list(row["t_id"], int_list=True)
media_type = row["media_type"]
expired = time_between_insertion.days > self.expiration
return id_to_return, media_type, expired

@ -241,7 +241,7 @@ class Convert:
cache_id, media_type, expired = self.config.Cache.query_guid_map(item.guid)
if cache_id and not expired:
media_id_type = "movie" if "movie" in media_type else "show"
return media_id_type, util.get_list(cache_id, int_list=True)
return media_id_type, cache_id
try:
guid = requests.utils.urlparse(item.guid)
item_type = guid.scheme.split(".")[-1]

@ -268,9 +268,9 @@ def mass_metadata(config, library, items):
t_id, guid_media_type, _ = config.Cache.query_guid_map(item.guid)
if t_id:
if "movie" in guid_media_type:
tmdb_id = t_id
tmdb_id = t_id[0]
else:
tvdb_id = t_id
tvdb_id = t_id[0]
if not tmdb_id and not tvdb_id:
tmdb_id = library.get_tmdb_from_map(item)
if not tmdb_id and not tvdb_id and library.is_show:

Loading…
Cancel
Save