From 108df093824520b603d0a6afc371bc095ee89ffc Mon Sep 17 00:00:00 2001 From: echel0n Date: Fri, 21 Mar 2014 10:26:22 -0700 Subject: [PATCH] Fix for air dates in TVRage API code --- lib/tvrage_api/tvrage_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tvrage_api/tvrage_api.py b/lib/tvrage_api/tvrage_api.py index e4df8e47..088a2c9a 100644 --- a/lib/tvrage_api/tvrage_api.py +++ b/lib/tvrage_api/tvrage_api.py @@ -395,7 +395,7 @@ class TVRage: if elm.tag in 'firstaired': try: - elm.text = re.sub("(0{4})([-]0{2}){1,}", str(dt.date.fromordinal(1)), elm.text) + if elm.text is "0000-00-00": elm.text = str(dt.date.fromordinal(1)) elm.text = re.sub("([-]0{2}){1,}", "", elm.text) fixDate = parse(elm.text, fuzzy=True).date() elm.text = fixDate.strftime("%Y-%m-%d")