mirror of
https://github.com/moparisthebest/SickRage
synced 2024-11-17 14:55:07 -05:00
Resolves issue #13
This commit is contained in:
parent
fc24efb957
commit
aa8667106f
@ -227,39 +227,38 @@ class QueueItemAdd(ShowQueueItem):
|
|||||||
ShowQueueItem.execute(self)
|
ShowQueueItem.execute(self)
|
||||||
|
|
||||||
logger.log(u"Starting to add show " + self.showDir)
|
logger.log(u"Starting to add show " + self.showDir)
|
||||||
|
# make sure the indexer ids are valid
|
||||||
try:
|
try:
|
||||||
# make sure the indexer ids are valid
|
|
||||||
try:
|
|
||||||
|
|
||||||
lINDEXER_API_PARMS = {'indexer': self.indexer}
|
lINDEXER_API_PARMS = {'indexer': self.indexer}
|
||||||
|
|
||||||
if self.lang:
|
if self.lang:
|
||||||
lINDEXER_API_PARMS['language'] = self.lang
|
lINDEXER_API_PARMS['language'] = self.lang
|
||||||
|
|
||||||
logger.log(u"" + self.indexer + ": " + repr(lINDEXER_API_PARMS))
|
logger.log(u"" + self.indexer + ": " + repr(lINDEXER_API_PARMS))
|
||||||
|
|
||||||
t = indexer_api.indexerApi(**lINDEXER_API_PARMS)
|
t = indexer_api.indexerApi(**lINDEXER_API_PARMS)
|
||||||
s = t[self.indexer_id]
|
s = t[self.indexer_id]
|
||||||
|
|
||||||
# this usually only happens if they have an NFO in their show dir which gave us a indexer ID that has no proper english version of the show
|
# this usually only happens if they have an NFO in their show dir which gave us a indexer ID that has no proper english version of the show
|
||||||
if not s['seriesname']:
|
if getattr(s, 'seriesname', None) is None:
|
||||||
logger.log(u"Show in " + self.showDir + " has no name on " + self.indexer + ", probably the wrong language used to search with.", logger.ERROR)
|
logger.log(u"Show in " + self.showDir + " has no name on " + self.indexer + ", probably the wrong language used to search with.", logger.ERROR)
|
||||||
ui.notifications.error("Unable to add show", "Show in " + self.showDir + " has no name on " + self.indexer + ", probably the wrong language. Delete .nfo and add manually in the correct language.")
|
ui.notifications.error("Unable to add show", "Show in " + self.showDir + " has no name on " + self.indexer + ", probably the wrong language. Delete .nfo and add manually in the correct language.")
|
||||||
self._finishEarly()
|
|
||||||
return
|
|
||||||
# if the show has no episodes/seasons
|
|
||||||
if not s:
|
|
||||||
logger.log(u"Show " + str(s['seriesname']) + " is on " + self.indexer + " but contains no season/episode data.", logger.ERROR)
|
|
||||||
ui.notifications.error("Unable to add show", "Show " + str(s['seriesname']) + " is on " + self.indexer + " but contains no season/episode data.")
|
|
||||||
self._finishEarly()
|
|
||||||
return
|
|
||||||
except indexer_exceptions.indexer_exception, e:
|
|
||||||
logger.log(u"Error contacting " + self.indexer + ": " + ex(e), logger.ERROR)
|
|
||||||
ui.notifications.error("Unable to add show", "Unable to look up the show in " + self.showDir + " on " + self.indexer + ", not using the NFO. Delete .nfo and add manually in the correct language or try a different Indexer.")
|
|
||||||
self._finishEarly()
|
self._finishEarly()
|
||||||
return
|
return
|
||||||
|
# if the show has no episodes/seasons
|
||||||
|
if not s:
|
||||||
|
logger.log(u"Show " + str(s['seriesname']) + " is on " + self.indexer + " but contains no season/episode data.", logger.ERROR)
|
||||||
|
ui.notifications.error("Unable to add show", "Show " + str(s['seriesname']) + " is on " + self.indexer + " but contains no season/episode data.")
|
||||||
|
self._finishEarly()
|
||||||
|
return
|
||||||
|
except Exception, e:
|
||||||
|
logger.log(u"Unable to find show ID:" + self.indexer_id + "on Indexer: " + self.indexer, logger.ERROR)
|
||||||
|
ui.notifications.error("Unable to add show", "Unable to look up the show in " + self.showDir + " on " + self.indexer + " using ID " + self.indexer_id + ", not using the NFO. Delete .nfo and try adding manually again.")
|
||||||
|
self._finishEarly()
|
||||||
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
# clear the name cache
|
# clear the name cache
|
||||||
name_cache.clearCache()
|
name_cache.clearCache()
|
||||||
|
|
||||||
@ -306,8 +305,6 @@ class QueueItemAdd(ShowQueueItem):
|
|||||||
except imdb_exceptions.IMDbError, e:
|
except imdb_exceptions.IMDbError, e:
|
||||||
#todo Insert UI notification
|
#todo Insert UI notification
|
||||||
logger.log(u" Something wrong on IMDb api: " + ex(e), logger.WARNING)
|
logger.log(u" Something wrong on IMDb api: " + ex(e), logger.WARNING)
|
||||||
except imdb_exceptions.IMDbParserError, e:
|
|
||||||
logger.log(u" IMDb_api parser error: " + ex(e), logger.WARNING)
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
logger.log(u"Error loading IMDb info: " + ex(e), logger.ERROR)
|
logger.log(u"Error loading IMDb info: " + ex(e), logger.ERROR)
|
||||||
logger.log(traceback.format_exc(), logger.DEBUG)
|
logger.log(traceback.format_exc(), logger.DEBUG)
|
||||||
@ -464,8 +461,6 @@ class QueueItemUpdate(ShowQueueItem):
|
|||||||
self.show.loadIMDbInfo()
|
self.show.loadIMDbInfo()
|
||||||
except imdb_exceptions.IMDbError, e:
|
except imdb_exceptions.IMDbError, e:
|
||||||
logger.log(u" Something wrong on IMDb api: " + ex(e), logger.WARNING)
|
logger.log(u" Something wrong on IMDb api: " + ex(e), logger.WARNING)
|
||||||
except imdb_exceptions.IMDbParserError, e:
|
|
||||||
logger.log(u" IMDb api parser error: " + ex(e), logger.WARNING)
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
logger.log(u"Error loading IMDb info: " + ex(e), logger.ERROR)
|
logger.log(u"Error loading IMDb info: " + ex(e), logger.ERROR)
|
||||||
logger.log(traceback.format_exc(), logger.DEBUG)
|
logger.log(traceback.format_exc(), logger.DEBUG)
|
||||||
|
Loading…
Reference in New Issue
Block a user