mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16:11 +00:00
Begin restructing, fixed some issues related to movement
This commit is contained in:
parent
6be8213b34
commit
84b8093171
72 changed files with 16 additions and 34 deletions
|
@ -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__)
|
||||
|
||||
|
|
|
@ -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__)
|
||||
|
||||
|
|
|
@ -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__)
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -5,7 +5,7 @@
|
|||
import logging
|
||||
|
||||
from client import JellyfinClient
|
||||
from helpers import has_attribute
|
||||
from helper import has_attribute
|
||||
|
||||
#################################################################################################
|
||||
|
|
@ -8,7 +8,7 @@ import threading
|
|||
|
||||
import xbmc
|
||||
|
||||
from ..resources import websocket
|
||||
from .. import websocket
|
||||
|
||||
##################################################################################################
|
||||
|
|
@ -1 +0,0 @@
|
|||
# Dummy file to make this directory a package.
|
|
@ -1,7 +0,0 @@
|
|||
|
||||
def has_attribute(obj, name):
|
||||
try:
|
||||
object.__getattribute__(obj, name)
|
||||
return True
|
||||
except AttributeError:
|
||||
return False
|
|
@ -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())
|
|
@ -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.")
|
||||
|
||||
|
|
Loading…
Reference in a new issue