Fix TMDB (film)
This commit is contained in:
+10
-8
@@ -128,7 +128,7 @@ def cache_response(fn):
|
|||||||
else:
|
else:
|
||||||
|
|
||||||
url = re.sub('&year=-', '', args[0])
|
url = re.sub('&year=-', '', args[0])
|
||||||
if PY3: url = str.encode(url)
|
# if PY3: url = str.encode(url)
|
||||||
|
|
||||||
row = db['tmdb_cache'].get(url)
|
row = db['tmdb_cache'].get(url)
|
||||||
|
|
||||||
@@ -898,6 +898,7 @@ class Tmdb(object):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
@cache_response
|
@cache_response
|
||||||
def get_json(url, cache=True):
|
def get_json(url, cache=True):
|
||||||
|
# from core.support import dbg;dbg()
|
||||||
try:
|
try:
|
||||||
result = httptools.downloadpage(url, cookies=False, ignore_response_code=True)
|
result = httptools.downloadpage(url, cookies=False, ignore_response_code=True)
|
||||||
|
|
||||||
@@ -954,6 +955,7 @@ class Tmdb(object):
|
|||||||
logger.error(traceback.format_exc())
|
logger.error(traceback.format_exc())
|
||||||
|
|
||||||
def __by_id(self, source='tmdb'):
|
def __by_id(self, source='tmdb'):
|
||||||
|
# from core.support import dbg;dbg()
|
||||||
|
|
||||||
if self.busqueda_id:
|
if self.busqueda_id:
|
||||||
if source == "tmdb":
|
if source == "tmdb":
|
||||||
@@ -1162,16 +1164,15 @@ class Tmdb(object):
|
|||||||
try:
|
try:
|
||||||
if self.load_resultado(r, p):
|
if self.load_resultado(r, p):
|
||||||
result = self.result.copy()
|
result = self.result.copy()
|
||||||
if result['first_air_date']:
|
|
||||||
|
|
||||||
result['thumbnail'] = self.get_poster(size="w300")
|
result['thumbnail'] = self.get_poster(size="w300")
|
||||||
result['fanart'] = self.get_backdrop()
|
result['fanart'] = self.get_backdrop()
|
||||||
|
|
||||||
res.append(result)
|
res.append(result)
|
||||||
cr += 1
|
cr += 1
|
||||||
|
|
||||||
if cr >= num_result:
|
if cr >= num_result:
|
||||||
return res
|
return res
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -1228,6 +1229,7 @@ class Tmdb(object):
|
|||||||
:rtype: str
|
:rtype: str
|
||||||
"""
|
"""
|
||||||
ret = ""
|
ret = ""
|
||||||
|
# from core.support import dbg;dbg()
|
||||||
|
|
||||||
if 'id' in self.result:
|
if 'id' in self.result:
|
||||||
ret = self.result.get('overview')
|
ret = self.result.get('overview')
|
||||||
|
|||||||
Reference in New Issue
Block a user