Skip to content

Commit

Permalink
Load TVDB info when AniDB is down on initial load
Browse files Browse the repository at this point in the history
  • Loading branch information
EndOfLine369 committed Jul 8, 2016
1 parent 3f13153 commit ea29c41
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,12 @@ def Update(self, metadata, media, lang, force, movie):
anime = None #return #if banned return ?
try: anime = self.xmlElementFromFile ( ANIDB_HTTP_API_URL + metadata_id_number, "AniDB/"+metadata_id_number+".xml", True, CACHE_1HOUR * 24).xpath('/anime')[0] # Put AniDB serie xml (cached if able) into 'anime'
except: Log.Error("Update() - AniDB Serie XML: Exception raised, probably no return in xmlElementFromFile")
if anime:

if not anime:
try:
if not metadata.title and tvdbtitle: metadata.title = tvdbtitle
except Exception as e:
Log.Error(e)
else:
### AniDB Title ###
try: title, orig = self.getAniDBTitle(anime.xpath('/anime/titles/title'), SERIE_LANGUAGE_PRIORITY)
except: Log.Debug("Update() - AniDB Title: Exception raised" )
Expand Down

0 comments on commit ea29c41

Please sign in to comment.