mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 02:52:20 -05:00
Automaticly determins the indexer for auto post-processing of shows. this should fix any other issues that were present with post processing
This commit is contained in:
parent
688888b17c
commit
581c4daca2
@ -602,6 +602,7 @@ class PostProcessor(object):
|
||||
try:
|
||||
showObj = helpers.findCertainShow(sickbeard.showList, indexer_id)
|
||||
if(showObj != None):
|
||||
self.indexer = showObj.indexer
|
||||
indexer_lang = showObj.lang
|
||||
except exceptions.MultipleShowObjectsException:
|
||||
raise #TODO: later I'll just log this, for now I want to know about it ASAP
|
||||
@ -825,8 +826,21 @@ class PostProcessor(object):
|
||||
|
||||
# if we don't have it then give up
|
||||
if not indexer_id or season == None or not episodes:
|
||||
self._log(u"Can't find show id from " + self.indexer + " or season or episode, skipping", logger.WARNING)
|
||||
return False
|
||||
if 'Tvdb' in self.indexer:
|
||||
self._log(u"Can't find show id from " + self.indexer + " or season or episode, trying other indexer", logger.WARNING)
|
||||
self.indexer = 'TVRage'
|
||||
else:
|
||||
self._log(u"Can't find show id from " + self.indexer + " or season or episode, trying other indexer", logger.WARNING)
|
||||
self.indexer = 'Tvdb'
|
||||
|
||||
sickbeard.INDEXER_API_PARMS['indexer'] = self.indexer
|
||||
|
||||
# try to find the file info with a different indexer
|
||||
(indexer_id, season, episodes) = self._find_info()
|
||||
|
||||
if not indexer_id or season == None or not episodes:
|
||||
self._log(u"Can't find show id from ANY of the indexers or season or episode, skipping", logger.WARNING)
|
||||
return False
|
||||
|
||||
# retrieve/create the corresponding TVEpisode objects
|
||||
ep_obj = self._get_ep_obj(indexer_id, season, episodes)
|
||||
|
@ -1938,10 +1938,10 @@ class TVEpisode(object):
|
||||
logger.log(str(self.indexerid) + u": File " + self.location + " is already named correctly, skipping", logger.DEBUG)
|
||||
return
|
||||
|
||||
related_files = postProcessor.PostProcessor(self.location).list_associated_files(self.location)
|
||||
related_files = postProcessor.PostProcessor(self.location, indexer=self.indexer).list_associated_files(self.location)
|
||||
|
||||
if self.show.subtitles and sickbeard.SUBTITLES_DIR != '':
|
||||
related_subs = postProcessor.PostProcessor(self.location).list_associated_files(sickbeard.SUBTITLES_DIR, subtitles_only=True)
|
||||
related_subs = postProcessor.PostProcessor(self.location, indexer=self.indexer).list_associated_files(sickbeard.SUBTITLES_DIR, subtitles_only=True)
|
||||
absolute_proper_subs_path = ek.ek(os.path.join, sickbeard.SUBTITLES_DIR, self.formatted_filename())
|
||||
|
||||
logger.log(u"Files associated to " + self.location + ": " + str(related_files), logger.DEBUG)
|
||||
|
Loading…
Reference in New Issue
Block a user