Merge branch 'feature/ChangeTvdbApi' into develop

This commit is contained in:
JackDandy 2018-05-17 04:33:28 +01:00
commit 0470331913
2 changed files with 6 additions and 1 deletions

View file

@ -9,6 +9,7 @@
'scene releases (srrDB/predb listed)', 'or contain' text or regex,
'non scene if no recent search results', 'non scene if no active search results',
'not scene nuked', and 'nuked if no active search results'
* Change improve tvdb_api performance; remember if episodes are cached and reload show if not and episodes are requested
[develop changelog]

View file

@ -122,6 +122,7 @@ class Show(dict):
def __init__(self):
dict.__init__(self)
self.data = {}
self.ep_loaded = False
def __repr__(self):
return '<Show %r (containing %s seasons)>' % (self.data.get(u'seriesname', 'instance'), len(self))
@ -857,6 +858,9 @@ class Tvdb:
for k, v in show_data['data'].iteritems():
self._set_show_data(sid, k, v)
if sid in self.shows:
self.shows[sid].ep_loaded = get_ep_info
p = ''
if self.config['posters_enabled']:
poster_data = self._getetsrc(self.config['url_seriesBanner'] % (sid, 'poster'), language=language)
@ -998,7 +1002,7 @@ class Tvdb:
if isinstance(key, (int, long)):
# Item is integer, treat as show id
if key not in self.shows:
if key not in self.shows or (not self.shows[key].ep_loaded and arg in (None, True)):
self._get_show_data(key, self.config['language'], (True, arg)[arg is not None])
return None if key not in self.shows else self.shows[key]