Begin restructing, fixed some issues related to movement

This commit is contained in:
TrueTechy 2019-11-01 00:43:20 +00:00 committed by Odd Stråbø
parent 6be8213b34
commit 84b8093171
72 changed files with 16 additions and 34 deletions

View File

@ -12,7 +12,7 @@ import xbmcaddon
#################################################################################################
__addon__ = xbmcaddon.Addon(id='plugin.video.jellyfin')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'resources', 'lib')).decode('utf-8')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'jellyfin_kodi')).decode('utf-8')
sys.path.insert(0, __base__)

View File

@ -12,7 +12,7 @@ import xbmcaddon
#################################################################################################
__addon__ = xbmcaddon.Addon(id='plugin.video.jellyfin')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'resources', 'lib')).decode('utf-8')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'jellyfin_kodi')).decode('utf-8')
sys.path.insert(0, __base__)

View File

@ -12,7 +12,7 @@ import xbmcaddon
#################################################################################################
__addon__ = xbmcaddon.Addon(id='plugin.video.jellyfin')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'resources', 'lib')).decode('utf-8')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'jellyfin_kodi')).decode('utf-8')
sys.path.insert(0, __base__)

View File

@ -17,6 +17,7 @@ from utils import compare_version
from utils import unzip
from utils import create_id
from utils import convert_to_local as Local
from utils import has_attribute
from wrapper import progress
from wrapper import catch

View File

@ -19,7 +19,7 @@ import xbmcaddon
import xbmcgui
import xbmcvfs
from .translate import _
from translate import _
#################################################################################################
@ -484,3 +484,10 @@ def convert_to_local(date):
LOG.exception(error)
return str(date)
def has_attribute(obj, name):
try:
object.__getattribute__(obj, name)
return True
except AttributeError:
return False

View File

@ -5,7 +5,7 @@
import logging
from client import JellyfinClient
from helpers import has_attribute
from helper import has_attribute
#################################################################################################

View File

@ -8,7 +8,7 @@ import threading
import xbmc
from ..resources import websocket
from .. import websocket
##################################################################################################

View File

@ -1 +0,0 @@
# Dummy file to make this directory a package.

View File

@ -1,7 +0,0 @@
def has_attribute(obj, name):
try:
object.__getattribute__(obj, name)
return True
except AttributeError:
return False

View File

@ -1,16 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################################
import logging
from uuid import uuid4
#################################################################################################
LOG = logging.getLogger('JELLYFIN.' + __name__)
#################################################################################################
def generate_client_id():
return str("%012X" % uuid4())

View File

@ -13,14 +13,14 @@ import xbmcaddon
#################################################################################################
__addon__ = xbmcaddon.Addon(id='plugin.video.jellyfin')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'resources', 'lib')).decode('utf-8')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'jellyfin_kodi')).decode('utf-8')
sys.path.insert(0, __base__)
#################################################################################################
from entrypoint import Service # noqa: F402
from helper import settings # noqa: F402
from helper.utils import settings # noqa: F402
#################################################################################################
@ -65,12 +65,10 @@ class ServiceManager(threading.Thread):
if __name__ == "__main__":
LOG.info("-->[ service ]")
LOG.info("Delay startup by %s seconds.", DELAY)
while True:
if not settings('enableAddon.bool'):
LOG.warning("Jellyfin for Kodi is not enabled.")