Fix for anidb errors

This commit is contained in:
echel0n 2014-06-30 09:21:21 -07:00
parent 75f69396d4
commit a16bf8ca2c
2 changed files with 13 additions and 12 deletions

View file

@ -224,9 +224,6 @@ class Anime(aniDBabstractObject):
class Episode(aniDBabstractObject):
def __init__(self, aniDB, number=None, epid=None, filePath=None, fid=None, epno=None, paramsA=None, paramsF=None, load=False, calculate=False):
if not aniDB and not number and not epid and not file and not fid:
return None
self.maper = AniDBMaper()
self.epid = epid
self.filePath = filePath

View file

@ -23,12 +23,11 @@ import threading
import regexes
import sickbeard
from sickbeard import logger, helpers, scene_numbering, common
from sickbeard import logger, helpers, scene_numbering, common, exceptions
from dateutil import parser
nameparser_lock = threading.Lock()
class NameParser(object):
ALL_REGEX = 0
NORMAL_REGEX = 1
@ -522,13 +521,18 @@ class ParseResult(object):
if self.show.is_anime and len(self.ab_episode_numbers):
for epAbsNo in self.ab_episode_numbers:
a = scene_numbering.get_indexer_absolute_numbering(self.show.indexerid, self.show.indexer, epAbsNo)
if a:
(s, e) = helpers.get_all_episodes_from_absolute_number(self.show, None, [a])
new_absolute_numbers.append(a)
new_episode_numbers.extend(e)
new_season_numbers.append(s)
ab = scene_numbering.get_indexer_absolute_numbering(self.show.indexerid, self.show.indexer, epAbsNo)
if ab:
try:
(s, e) = helpers.get_all_episodes_from_absolute_number(self.show, None, [ab])
except exceptions.EpisodeNotFoundByAbsoluteNumberException:
logger.log(str(self.show.indexerid) + ": Indexer object absolute number " + str(
ab) + " is incomplete, skipping this episode")
return self
else:
new_absolute_numbers.append(ab)
new_episode_numbers.extend(e)
new_season_numbers.append(s)
elif self.season_number and len(self.episode_numbers):
for epNo in self.episode_numbers: