mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-04 15:12:23 -05:00
Fixed Indexer API issues resulting in NoneType errors when no data was available for a show
This commit is contained in:
parent
67dc6d9194
commit
e3500fffc1
@ -1,5 +1,5 @@
|
||||
# !/usr/bin/env python2
|
||||
#encoding:utf-8
|
||||
# encoding:utf-8
|
||||
#author:dbr/Ben
|
||||
#project:tvdb_api
|
||||
#repository:http://github.com/dbr/tvdb_api
|
||||
@ -598,9 +598,9 @@ class Tvdb:
|
||||
value = parse(value, fuzzy=True).date()
|
||||
value = value.strftime("%Y-%m-%d")
|
||||
|
||||
#if key == 'airs_time':
|
||||
# value = parse(value).time()
|
||||
# value = value.strftime("%I:%M %p")
|
||||
#if key == 'airs_time':
|
||||
# value = parse(value).time()
|
||||
# value = value.strftime("%I:%M %p")
|
||||
except:
|
||||
pass
|
||||
|
||||
@ -840,19 +840,20 @@ class Tvdb:
|
||||
self.config['url_seriesInfo'] % (sid, getShowInLanguage)
|
||||
)
|
||||
|
||||
# check and make sure we have data to process and that it contains a series name
|
||||
if not len(seriesInfoEt) or (isinstance(seriesInfoEt, dict) and 'seriesname' not in seriesInfoEt['series']):
|
||||
# get series data
|
||||
try:
|
||||
for k, v in seriesInfoEt['series'].items():
|
||||
if v is not None:
|
||||
if k in ['banner', 'fanart', 'poster']:
|
||||
v = self.config['url_artworkPrefix'] % (v)
|
||||
else:
|
||||
v = self._cleanData(v)
|
||||
|
||||
self._setShowData(sid, k, v)
|
||||
except:
|
||||
return False
|
||||
|
||||
for k, v in seriesInfoEt['series'].items():
|
||||
if v is not None:
|
||||
if k in ['banner', 'fanart', 'poster']:
|
||||
v = self.config['url_artworkPrefix'] % (v)
|
||||
else:
|
||||
v = self._cleanData(v)
|
||||
|
||||
self._setShowData(sid, k, v)
|
||||
|
||||
# get episode data
|
||||
if getEpInfo:
|
||||
# Parse banners
|
||||
if self.config['banners_enabled']:
|
||||
|
@ -588,17 +588,17 @@ class TVRage:
|
||||
self.config['params_seriesInfo']
|
||||
)
|
||||
|
||||
# check and make sure we have data to process and that it contains a series name
|
||||
if not len(seriesInfoEt) or (isinstance(seriesInfoEt, dict) and 'seriesname' not in seriesInfoEt):
|
||||
# get series data
|
||||
try:
|
||||
for k, v in seriesInfoEt.items():
|
||||
if v is not None:
|
||||
v = self._cleanData(v)
|
||||
|
||||
self._setShowData(sid, k, v)
|
||||
except:
|
||||
return False
|
||||
|
||||
for k, v in seriesInfoEt.items():
|
||||
if v is not None:
|
||||
v = self._cleanData(v)
|
||||
|
||||
self._setShowData(sid, k, v)
|
||||
|
||||
# series search ends here
|
||||
# get episode data
|
||||
if getEpInfo:
|
||||
# Parse episode data
|
||||
log().debug('Getting all episodes of %s' % (sid))
|
||||
|
Loading…
Reference in New Issue
Block a user