From 71873963d2306d38d50e9faa35bd29e3c1dbe6a8 Mon Sep 17 00:00:00 2001 From: Cayde Dixon Date: Thu, 16 May 2019 01:50:13 +1000 Subject: [PATCH] Forgot a bit with airdate. --- Contents/Code/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Contents/Code/__init__.py b/Contents/Code/__init__.py index 054876c..97036ba 100644 --- a/Contents/Code/__init__.py +++ b/Contents/Code/__init__.py @@ -198,8 +198,10 @@ def Update(self, metadata, media, lang, force, movie): episodeObj.summary = summary_sanitizer(ep['summary']) Log("" + str(ep['epnumber']) + ": " + ep['summary']) - if ep['air'] != '1/01/0001 12:00:00 AM' and ep['air'] != '0001-01-01': - episodeObj.originally_available_at = datetime.strptime(ep['air'], "%Y-%m-%d").date() + airdate = try_get(ep, 'air', '1/01/0001 12:00:00 AM') + + if airdate != '1/01/0001 12:00:00 AM' and airdate != '0001-01-01': + episodeObj.originally_available_at = datetime.strptime(airdate, "%Y-%m-%d").date() if len(ep['art']['thumb']) and Prefs['customThumbs']: self.metadata_add(episodeObj.thumbs, ep['art']['thumb'])