From 8c1903d63269437fbdd270acaaa3753fcca833d3 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Mon, 4 Feb 2019 01:56:52 -0600 Subject: [PATCH 1/4] Reload objects mapping Upon restarting service --- resources/lib/entrypoint/service.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/lib/entrypoint/service.py b/resources/lib/entrypoint/service.py index 74e01a72..f3fb953d 100644 --- a/resources/lib/entrypoint/service.py +++ b/resources/lib/entrypoint/service.py @@ -437,6 +437,8 @@ class Service(xbmc.Monitor): reload(library) reload(monitor) + objects.obj.Objects().mapping() + LOG.warn("---[ objects reloaded ]") def shutdown(self): From 2e2ca1c7aad6f7dafa3f935a36c6c0ccb8557061 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sun, 3 Feb 2019 22:08:59 -0600 Subject: [PATCH 2/4] Support server 3.x with Leia --- resources/lib/webservice.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lib/webservice.py b/resources/lib/webservice.py index 99b23c88..ce18abb0 100644 --- a/resources/lib/webservice.py +++ b/resources/lib/webservice.py @@ -118,11 +118,11 @@ class requestHandler(BaseHTTPServer.BaseHTTPRequestHandler): try: params = self.get_params() - if not params: + if not params or params.get('Id') is None: raise IndexError("Incomplete URL format") - if not params.get('Id').isdigit(): - raise IndexError("Incorrect Id format %s" % params.get('Id')) + if 'extrafanart' in params['Id']: + raise IndexError("Incorrect Id format %s" % params['Id']) xbmc.log("[ webservice ] path: %s params: %s" % (str(self.path), str(params)), xbmc.LOGWARNING) From 93dd35b64d70b50cb6e3d649e77f21e344780966 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Mon, 4 Feb 2019 02:01:22 -0600 Subject: [PATCH 3/4] Merge pull request #209 from libanp/develop Fix version checks --- resources/lib/helper/utils.py | 24 +++++------------ .../lib/jellyfin/core/connection_manager.py | 26 ++++++------------- 2 files changed, 15 insertions(+), 35 deletions(-) diff --git a/resources/lib/helper/utils.py b/resources/lib/helper/utils.py index da7bee4d..97906727 100644 --- a/resources/lib/helper/utils.py +++ b/resources/lib/helper/utils.py @@ -10,6 +10,7 @@ import re import unicodedata import urllib from uuid import uuid4 +from distutils.version import LooseVersion import xbmc import xbmcaddon @@ -95,25 +96,14 @@ def compare_version(a, b): 1 a is larger 0 equal ''' - a = a.split('.') - b = b.split('.') + a = LooseVersion(a) + b = LooseVersion(b) - for i in range(0, max(len(a), len(b)), 1): - try: - aVal = a[i] - except IndexError: - aVal = 0 + if a < b: + return -1 - try: - bVal = b[i] - except IndexError: - bVal = 0 - - if aVal < bVal: - return -1 - - if aVal > bVal: - return 1 + if a > b: + return 1 return 0 diff --git a/resources/lib/jellyfin/core/connection_manager.py b/resources/lib/jellyfin/core/connection_manager.py index b16108ff..176ccedd 100644 --- a/resources/lib/jellyfin/core/connection_manager.py +++ b/resources/lib/jellyfin/core/connection_manager.py @@ -8,6 +8,7 @@ import hashlib import socket import time from datetime import datetime +from distutils.version import LooseVersion from credentials import Credentials from http import HTTP @@ -394,26 +395,15 @@ class ConnectionManager(object): 1 a is larger 0 equal ''' - a = a.split('.') - b = b.split('.') + a = LooseVersion(a) + b = LooseVersion(b) - for i in range(0, max(len(a), len(b)), 1): - try: - aVal = a[i] - except IndexError: - aVal = 0 - - try: - bVal = b[i] - except IndexError: - bVal = 0 - - if aVal < bVal: - return -1 - - if aVal > bVal: - return 1 + if a < b: + return -1 + if a > b: + return 1 + return 0 def _string_equals_ignore_case(self, str1, str2): From 3f0c1f4e050efb0990fd461c83e15712b147f18e Mon Sep 17 00:00:00 2001 From: Claus Vium Date: Mon, 4 Feb 2019 22:28:02 +0100 Subject: [PATCH 4/4] Remove id check since it seems we don't need it --- resources/lib/webservice.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/resources/lib/webservice.py b/resources/lib/webservice.py index ce18abb0..ab17e21e 100644 --- a/resources/lib/webservice.py +++ b/resources/lib/webservice.py @@ -121,9 +121,6 @@ class requestHandler(BaseHTTPServer.BaseHTTPRequestHandler): if not params or params.get('Id') is None: raise IndexError("Incomplete URL format") - if 'extrafanart' in params['Id']: - raise IndexError("Incorrect Id format %s" % params['Id']) - xbmc.log("[ webservice ] path: %s params: %s" % (str(self.path), str(params)), xbmc.LOGWARNING) path = ("plugin://plugin.video.jellyfin?mode=play&id=%s&dbid=%s&filename=%s&transcode=%s"