mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
check LocalTrailerCount as a number
dont log metrics for 400 errors as they are mostly server issues
This commit is contained in:
parent
62c284fdd7
commit
4aef5d7551
3 changed files with 6 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<addon id="plugin.video.emby"
|
||||
name="Emby"
|
||||
version="2.3.19"
|
||||
version="2.3.20"
|
||||
provider-name="Emby.media">
|
||||
<requires>
|
||||
<import addon="xbmc.python" version="2.19.0"/>
|
||||
|
|
|
@ -293,7 +293,7 @@ class DownloadUtils(object):
|
|||
|
||||
if response.status_code == 400:
|
||||
log.error("Malformed request: %s", error)
|
||||
raise Warning('400:' + str(error))
|
||||
raise internal_exceptions.ExceptionWrapper(error)
|
||||
|
||||
if response.status_code == 401:
|
||||
# Unauthorized
|
||||
|
|
|
@ -178,17 +178,17 @@ class Movies(Items):
|
|||
except IndexError:
|
||||
studio = None
|
||||
|
||||
if item.get('LocalTrailerCount'):
|
||||
if int(item.get('LocalTrailerCount', 0)) > 0:
|
||||
# There's a local trailer
|
||||
url = (
|
||||
"{server}/emby/Users/{UserId}/Items/%s/LocalTrailers?format=json"
|
||||
% itemid
|
||||
)
|
||||
result = self.do_url(url)
|
||||
try:
|
||||
result = self.do_url(url)
|
||||
trailer = "plugin://plugin.video.emby/trailer/?id=%s&mode=play" % result[0]['Id']
|
||||
except IndexError:
|
||||
log.info("Failed to process local trailer.")
|
||||
except Exception as error:
|
||||
log.info("Failed to process local trailer: " + str(error))
|
||||
trailer = None
|
||||
else:
|
||||
# Try to get the youtube trailer
|
||||
|
|
Loading…
Reference in a new issue