mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-05-07 01:48:47 +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
|
@ -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…
Add table
Add a link
Reference in a new issue