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