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): 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): diff --git a/resources/lib/webservice.py b/resources/lib/webservice.py index 99b23c88..ab17e21e 100644 --- a/resources/lib/webservice.py +++ b/resources/lib/webservice.py @@ -118,12 +118,9 @@ 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')) - 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"