mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-04 11:43:32 +00:00
commit
7212e135c3
@ -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__)
|
||||
|
||||
|
@ -12,8 +12,8 @@ from database import get_credentials, save_credentials
|
||||
from dialogs import ServerConnect, UsersConnect, LoginManual, ServerManual
|
||||
from helper import settings, addon_id, event, api, window
|
||||
from jellyfin import Jellyfin
|
||||
from jellyfin.core.connection_manager import CONNECTION_STATE
|
||||
from jellyfin.core.exceptions import HTTPException
|
||||
from jellyfin.connection_manager import CONNECTION_STATE
|
||||
from jellyfin.exceptions import HTTPException
|
||||
|
||||
##################################################################################################
|
||||
|
@ -8,7 +8,7 @@ import xbmc
|
||||
import xbmcgui
|
||||
|
||||
from helper import _
|
||||
from jellyfin.core.connection_manager import CONNECTION_STATE
|
||||
from jellyfin.connection_manager import CONNECTION_STATE
|
||||
|
||||
##################################################################################################
|
||||
|
@ -10,7 +10,7 @@ import xbmcgui
|
||||
import xbmcaddon
|
||||
|
||||
from helper import _, addon_id
|
||||
from jellyfin.core.connection_manager import CONNECTION_STATE
|
||||
from jellyfin.connection_manager import CONNECTION_STATE
|
||||
|
||||
##################################################################################################
|
||||
|
@ -10,8 +10,8 @@ import xbmc
|
||||
import requests
|
||||
from helper import settings, stop, event, window, create_id
|
||||
from jellyfin import Jellyfin
|
||||
from jellyfin.core import api
|
||||
from jellyfin.core.exceptions import HTTPException
|
||||
from jellyfin import api
|
||||
from jellyfin.exceptions import HTTPException
|
||||
|
||||
#################################################################################################
|
||||
|
@ -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
|
||||
|
||||
#################################################################################################
|
||||
|
@ -4,11 +4,11 @@
|
||||
|
||||
import logging
|
||||
|
||||
import core.api as api
|
||||
from core.configuration import Config
|
||||
from core.http import HTTP
|
||||
from core.ws_client import WSClient
|
||||
from core.connection_manager import ConnectionManager, CONNECTION_STATE
|
||||
import api
|
||||
from configuration import Config
|
||||
from http import HTTP
|
||||
from ws_client import WSClient
|
||||
from connection_manager import ConnectionManager, CONNECTION_STATE
|
||||
|
||||
#################################################################################################
|
||||
|
@ -8,7 +8,7 @@ import threading
|
||||
|
||||
import xbmc
|
||||
|
||||
from ..resources import websocket
|
||||
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 New Issue
Block a user