for for imdb convert

pull/309/head
meisnate12 4 years ago
parent 53f29e927f
commit b192e51f5f

@ -155,7 +155,7 @@ class Cache:
if row and row[to_id]: if row and row[to_id]:
datetime_object = datetime.strptime(row["expiration_date"], "%Y-%m-%d") datetime_object = datetime.strptime(row["expiration_date"], "%Y-%m-%d")
time_between_insertion = datetime.now() - datetime_object time_between_insertion = datetime.now() - datetime_object
id_to_return = int(row[to_id]) id_to_return = row[to_id] if to_id == "imdb_id" else int(row[to_id])
expired = time_between_insertion.days > self.expiration expired = time_between_insertion.days > self.expiration
return id_to_return, expired return id_to_return, expired

Loading…
Cancel
Save