mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-05-01 15:08:48 +00:00
Merge pull request #277 from oddstr13/pr-logging-2
Attempt to improve logging
This commit is contained in:
commit
87af711c94
55 changed files with 159 additions and 184 deletions
|
@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -19,10 +18,11 @@ sys.path.insert(0, __base__)
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
from entrypoint import Context # noqa: F402
|
from entrypoint import Context # noqa: F402
|
||||||
|
from helper import LazyLogger # noqa: F402
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN.context")
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -19,10 +18,11 @@ sys.path.insert(0, __base__)
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
from entrypoint import Context # noqa: F402
|
from entrypoint import Context # noqa: F402
|
||||||
|
from helper import LazyLogger # noqa: F402
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN.context")
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -19,10 +18,11 @@ sys.path.insert(0, __base__)
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
from entrypoint import Events # noqa: F402
|
from entrypoint import Events # noqa: F402
|
||||||
|
from helper import LazyLogger # noqa: F402
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN.default")
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,17 +3,17 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from kodi_six import xbmc, xbmcaddon, xbmcvfs
|
from kodi_six import xbmc, xbmcaddon, xbmcvfs
|
||||||
|
|
||||||
from helper import translate, window, settings, addon_id, dialog
|
from helper import translate, window, settings, addon_id, dialog
|
||||||
from helper.utils import create_id
|
from helper.utils import create_id
|
||||||
|
from helper import LazyLogger # noqa: F402
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ def get_device_id(reset=False):
|
||||||
file_guid.close()
|
file_guid.close()
|
||||||
LOG.debug("DeviceId loaded: %s", client_id)
|
LOG.debug("DeviceId loaded: %s", client_id)
|
||||||
window('jellyfin_deviceId', value=client_id)
|
window('jellyfin_deviceId', value=client_id)
|
||||||
|
|
||||||
return client_id
|
return client_id
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from kodi_six import xbmc, xbmcaddon
|
from kodi_six import xbmc, xbmcaddon
|
||||||
|
|
||||||
import client
|
import client
|
||||||
|
@ -14,10 +12,11 @@ from helper import settings, addon_id, event, api, window
|
||||||
from jellyfin import Jellyfin
|
from jellyfin import Jellyfin
|
||||||
from jellyfin.connection_manager import CONNECTION_STATE
|
from jellyfin.connection_manager import CONNECTION_STATE
|
||||||
from jellyfin.exceptions import HTTPException
|
from jellyfin.exceptions import HTTPException
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
XML_PATH = (xbmcaddon.Addon(addon_id()).getAddonInfo('path'), "default", "1080i")
|
XML_PATH = (xbmcaddon.Addon(addon_id()).getAddonInfo('path'), "default", "1080i")
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
|
@ -14,10 +14,11 @@ from six import text_type
|
||||||
from database import jellyfin_db
|
from database import jellyfin_db
|
||||||
from helper import translate, settings, window, dialog
|
from helper import translate, settings, window, dialog
|
||||||
from objects import obj
|
from objects import obj
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,12 @@
|
||||||
from __future__ import division, absolute_import, print_function, unicode_literals
|
from __future__ import division, absolute_import, print_function, unicode_literals
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from database import queries as QU
|
from database import queries as QU
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,17 +3,17 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from kodi_six import xbmcgui, xbmcaddon
|
from kodi_six import xbmcgui, xbmcaddon
|
||||||
from six import ensure_text
|
from six import ensure_text
|
||||||
|
|
||||||
from helper import window, addon_id
|
from helper import window, addon_id
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
ACTION_PARENT_DIR = 9
|
ACTION_PARENT_DIR = 9
|
||||||
ACTION_PREVIOUS_MENU = 10
|
ACTION_PREVIOUS_MENU = 10
|
||||||
ACTION_BACK = 92
|
ACTION_BACK = 92
|
||||||
|
|
|
@ -3,17 +3,17 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
from kodi_six import xbmcgui, xbmcaddon
|
from kodi_six import xbmcgui, xbmcaddon
|
||||||
|
|
||||||
from helper import translate, addon_id
|
from helper import translate, addon_id
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
ACTION_PARENT_DIR = 9
|
ACTION_PARENT_DIR = 9
|
||||||
ACTION_PREVIOUS_MENU = 10
|
ACTION_PREVIOUS_MENU = 10
|
||||||
ACTION_BACK = 92
|
ACTION_BACK = 92
|
||||||
|
|
|
@ -3,13 +3,13 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from kodi_six import xbmc, xbmcgui
|
from kodi_six import xbmc, xbmcgui
|
||||||
|
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
ACTION_PARENT_DIR = 9
|
ACTION_PARENT_DIR = 9
|
||||||
ACTION_PREVIOUS_MENU = 10
|
ACTION_PREVIOUS_MENU = 10
|
||||||
ACTION_BACK = 92
|
ACTION_BACK = 92
|
||||||
|
|
|
@ -3,17 +3,16 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
from kodi_six import xbmc, xbmcgui
|
from kodi_six import xbmc, xbmcgui
|
||||||
|
|
||||||
from helper import translate
|
from helper import translate
|
||||||
from jellyfin.connection_manager import CONNECTION_STATE
|
from jellyfin.connection_manager import CONNECTION_STATE
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
ACTION_PARENT_DIR = 9
|
ACTION_PARENT_DIR = 9
|
||||||
ACTION_PREVIOUS_MENU = 10
|
ACTION_PREVIOUS_MENU = 10
|
||||||
ACTION_BACK = 92
|
ACTION_BACK = 92
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
@ -12,10 +11,11 @@ from kodi_six import xbmcgui, xbmcaddon
|
||||||
|
|
||||||
from helper import translate, addon_id
|
from helper import translate, addon_id
|
||||||
from jellyfin.connection_manager import CONNECTION_STATE
|
from jellyfin.connection_manager import CONNECTION_STATE
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
ACTION_PARENT_DIR = 9
|
ACTION_PARENT_DIR = 9
|
||||||
ACTION_PREVIOUS_MENU = 10
|
ACTION_PREVIOUS_MENU = 10
|
||||||
ACTION_BACK = 92
|
ACTION_BACK = 92
|
||||||
|
|
|
@ -3,14 +3,14 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
from kodi_six import xbmc, xbmcgui
|
from kodi_six import xbmc, xbmcgui
|
||||||
|
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
ACTION_PARENT_DIR = 9
|
ACTION_PARENT_DIR = 9
|
||||||
ACTION_PREVIOUS_MENU = 10
|
ACTION_PREVIOUS_MENU = 10
|
||||||
ACTION_BACK = 92
|
ACTION_BACK = 92
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import threading
|
import threading
|
||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
from datetime import date
|
from datetime import date
|
||||||
|
@ -16,10 +15,11 @@ from helper import settings, stop, event, window, create_id
|
||||||
from jellyfin import Jellyfin
|
from jellyfin import Jellyfin
|
||||||
from jellyfin import api
|
from jellyfin import api
|
||||||
from jellyfin.exceptions import HTTPException
|
from jellyfin.exceptions import HTTPException
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
LIMIT = min(int(settings('limitIndex') or 50), 50)
|
LIMIT = min(int(settings('limitIndex') or 50), 50)
|
||||||
DTHREADS = int(settings('limitThreads') or 3)
|
DTHREADS = int(settings('limitThreads') or 3)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import logging
|
||||||
|
|
||||||
from kodi_six import xbmc, xbmcvfs
|
from kodi_six import xbmc, xbmcvfs
|
||||||
|
|
||||||
from helper import loghandler
|
from helper import LazyLogger
|
||||||
from jellyfin import Jellyfin
|
from jellyfin import Jellyfin
|
||||||
|
|
||||||
from .default import Events
|
from .default import Events
|
||||||
|
@ -16,9 +16,6 @@ from .context import Context
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
Jellyfin.set_loghandler(loghandler.LogHandler, logging.DEBUG)
|
LOG = LazyLogger(__name__)
|
||||||
loghandler.reset()
|
|
||||||
loghandler.config()
|
|
||||||
LOG = logging.getLogger('JELLYFIN.entrypoint')
|
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
|
@ -4,7 +4,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from kodi_six import xbmc, xbmcaddon
|
from kodi_six import xbmc, xbmcaddon
|
||||||
|
@ -13,10 +12,11 @@ import database
|
||||||
from dialogs import context
|
from dialogs import context
|
||||||
from helper import translate, settings, dialog
|
from helper import translate, settings, dialog
|
||||||
from downloader import TheVoid
|
from downloader import TheVoid
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
XML_PATH = (xbmcaddon.Addon('plugin.video.jellyfin').getAddonInfo('path'), "default", "1080i")
|
XML_PATH = (xbmcaddon.Addon('plugin.video.jellyfin').getAddonInfo('path'), "default", "1080i")
|
||||||
OPTIONS = {
|
OPTIONS = {
|
||||||
'Refresh': translate(30410),
|
'Refresh': translate(30410),
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
@ -17,10 +16,11 @@ from objects import Objects, Actions
|
||||||
from downloader import TheVoid
|
from downloader import TheVoid
|
||||||
from helper import translate, event, settings, window, dialog, api, JSONRPC
|
from helper import translate, event, settings, window, dialog, api, JSONRPC
|
||||||
from helper.utils import JsonDebugPrinter
|
from helper.utils import JsonDebugPrinter
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
import sys
|
import sys
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
@ -22,10 +21,11 @@ from views import Views, verify_kodi_defaults
|
||||||
from helper import translate, window, settings, event, dialog, set_addon_mode
|
from helper import translate, window, settings, event, dialog, set_addon_mode
|
||||||
from helper.utils import JsonDebugPrinter
|
from helper.utils import JsonDebugPrinter
|
||||||
from jellyfin import Jellyfin
|
from jellyfin import Jellyfin
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@ class Service(xbmc.Monitor):
|
||||||
self.settings['enable_context'] = settings('enableContext.bool')
|
self.settings['enable_context'] = settings('enableContext.bool')
|
||||||
self.settings['enable_context_transcode'] = settings('enableContextTranscode.bool')
|
self.settings['enable_context_transcode'] = settings('enableContextTranscode.bool')
|
||||||
self.settings['kodi_companion'] = settings('kodiCompanion.bool')
|
self.settings['kodi_companion'] = settings('kodiCompanion.bool')
|
||||||
window('jellyfin_logLevel', value=str(self.settings['log_level']))
|
|
||||||
window('jellyfin_kodiProfile', value=self.settings['profile'])
|
window('jellyfin_kodiProfile', value=self.settings['profile'])
|
||||||
settings('platformDetected', client.get_platform())
|
settings('platformDetected', client.get_platform())
|
||||||
|
|
||||||
|
@ -356,7 +355,6 @@ class Service(xbmc.Monitor):
|
||||||
if settings('logLevel') != self.settings['log_level']:
|
if settings('logLevel') != self.settings['log_level']:
|
||||||
|
|
||||||
log_level = settings('logLevel')
|
log_level = settings('logLevel')
|
||||||
window('jellyfin_logLevel', str(log_level))
|
|
||||||
self.settings['logLevel'] = log_level
|
self.settings['logLevel'] = log_level
|
||||||
LOG.info("New log level: %s", log_level)
|
LOG.info("New log level: %s", log_level)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
|
||||||
|
|
||||||
from kodi_six import xbmc
|
from kodi_six import xbmc
|
||||||
|
|
||||||
|
@ -15,10 +14,11 @@ from objects import Movies, TVShows, MusicVideos, Music
|
||||||
from database import Database, get_sync, save_sync, jellyfin_db
|
from database import Database, get_sync, save_sync, jellyfin_db
|
||||||
from helper import translate, settings, window, progress, dialog, LibraryException
|
from helper import translate, settings, window, progress, dialog, LibraryException
|
||||||
from helper.utils import get_screensaver, set_screensaver
|
from helper.utils import get_screensaver, set_screensaver
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
from __future__ import division, absolute_import, print_function, unicode_literals
|
from __future__ import division, absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
|
from .lazylogger import LazyLogger
|
||||||
|
|
||||||
from .translate import translate
|
from .translate import translate
|
||||||
from .exceptions import LibraryException
|
from .exceptions import LibraryException
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,13 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
from helper import LazyLogger
|
||||||
|
|
||||||
from . import settings
|
from . import settings
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
19
jellyfin_kodi/helper/lazylogger.py
Normal file
19
jellyfin_kodi/helper/lazylogger.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import division, absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
|
|
||||||
|
class LazyLogger(object):
|
||||||
|
"""`helper.loghandler.getLogger()` is used everywhere.
|
||||||
|
This class helps avoiding import errors.
|
||||||
|
"""
|
||||||
|
__logger = None
|
||||||
|
__logger_name = None
|
||||||
|
|
||||||
|
def __init__(self, logger_name=None):
|
||||||
|
self.__logger_name = logger_name
|
||||||
|
|
||||||
|
def __getattr__(self, name):
|
||||||
|
if self.__logger is None:
|
||||||
|
from helper.loghandler import getLogger
|
||||||
|
self.__logger = getLogger(self.__logger_name)
|
||||||
|
return getattr(self.__logger, name)
|
|
@ -1,9 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import division, absolute_import, print_function, unicode_literals
|
from __future__ import division, absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
@ -13,7 +10,7 @@ import traceback
|
||||||
from kodi_six import xbmc, xbmcaddon
|
from kodi_six import xbmc, xbmcaddon
|
||||||
import database
|
import database
|
||||||
|
|
||||||
from . import window, settings
|
from . import settings
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
@ -23,17 +20,11 @@ __pluginpath__ = xbmc.translatePath(__addon__.getAddonInfo('path'))
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
||||||
def config():
|
def getLogger(name=None):
|
||||||
|
if name is None:
|
||||||
|
return __LOGGER
|
||||||
|
|
||||||
logger = logging.getLogger('JELLYFIN')
|
return __LOGGER.getChild(name)
|
||||||
logger.addHandler(LogHandler())
|
|
||||||
logger.setLevel(logging.DEBUG)
|
|
||||||
|
|
||||||
|
|
||||||
def reset():
|
|
||||||
|
|
||||||
for handler in logging.getLogger('JELLYFIN').handlers:
|
|
||||||
logging.getLogger('JELLYFIN').removeHandler(handler)
|
|
||||||
|
|
||||||
|
|
||||||
class LogHandler(logging.StreamHandler):
|
class LogHandler(logging.StreamHandler):
|
||||||
|
@ -70,10 +61,7 @@ class LogHandler(logging.StreamHandler):
|
||||||
for token in self.sensitive['Token']:
|
for token in self.sensitive['Token']:
|
||||||
string = string.replace(token or "{token}", "{jellyfin-token}")
|
string = string.replace(token or "{token}", "{jellyfin-token}")
|
||||||
|
|
||||||
try:
|
xbmc.log(string, level=xbmc.LOGNOTICE)
|
||||||
xbmc.log(string, level=xbmc.LOGNOTICE)
|
|
||||||
except UnicodeEncodeError:
|
|
||||||
xbmc.log(string, level=xbmc.LOGNOTICE)
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _get_log_level(cls, level):
|
def _get_log_level(cls, level):
|
||||||
|
@ -85,36 +73,24 @@ class LogHandler(logging.StreamHandler):
|
||||||
logging.DEBUG: 2
|
logging.DEBUG: 2
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
log_level = int(window('jellyfin_logLevel'))
|
log_level = int(settings('logLevel'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
log_level = 0
|
log_level = 2 # If getting settings fail, we probably want debug logging.
|
||||||
|
|
||||||
return log_level >= levels[level]
|
return log_level >= levels[level]
|
||||||
|
|
||||||
|
|
||||||
class MyFormatter(logging.Formatter):
|
class MyFormatter(logging.Formatter):
|
||||||
|
|
||||||
def __init__(self, fmt="%(name)s -> %(message)s"):
|
def __init__(self, fmt='%(name)s -> %(levelname)s::%(relpath)s:%(lineno)s %(message)s'):
|
||||||
|
|
||||||
logging.Formatter.__init__(self, fmt)
|
logging.Formatter.__init__(self, fmt)
|
||||||
|
|
||||||
def format(self, record):
|
def format(self, record):
|
||||||
|
|
||||||
# Save the original format configured by the user
|
|
||||||
# when the logger formatter was instantiated
|
|
||||||
format_orig = self._fmt
|
|
||||||
|
|
||||||
self._gen_rel_path(record)
|
self._gen_rel_path(record)
|
||||||
|
|
||||||
# Replace the original format with one customized by logging level
|
|
||||||
self._fmt = '%(name)s -> %(levelname)s::%(relpath)s:%(lineno)s %(message)s'
|
|
||||||
|
|
||||||
# Call the original formatter class to do the grunt work
|
# Call the original formatter class to do the grunt work
|
||||||
result = logging.Formatter.format(self, record)
|
result = logging.Formatter.format(self, record)
|
||||||
|
|
||||||
# Restore the original format configured by the user
|
|
||||||
self._fmt = format_orig
|
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def formatException(self, exc_info):
|
def formatException(self, exc_info):
|
||||||
|
@ -136,3 +112,11 @@ class MyFormatter(logging.Formatter):
|
||||||
def _gen_rel_path(self, record):
|
def _gen_rel_path(self, record):
|
||||||
if record.pathname:
|
if record.pathname:
|
||||||
record.relpath = os.path.relpath(record.pathname, __pluginpath__)
|
record.relpath = os.path.relpath(record.pathname, __pluginpath__)
|
||||||
|
|
||||||
|
|
||||||
|
__LOGGER = logging.getLogger('JELLYFIN')
|
||||||
|
for handler in __LOGGER.handlers:
|
||||||
|
__LOGGER.removeHandler(handler)
|
||||||
|
|
||||||
|
__LOGGER.addHandler(LogHandler())
|
||||||
|
__LOGGER.setLevel(logging.DEBUG)
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
import collections
|
import collections
|
||||||
|
@ -15,10 +14,11 @@ import requests
|
||||||
from downloader import TheVoid
|
from downloader import TheVoid
|
||||||
|
|
||||||
from . import translate, settings, window, dialog, api
|
from . import translate, settings, window, dialog, api
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,13 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from kodi_six import xbmc, xbmcaddon
|
from kodi_six import xbmc, xbmcaddon
|
||||||
|
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger('JELLYFIN.' + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import unicodedata
|
import unicodedata
|
||||||
|
@ -18,11 +17,12 @@ from six.moves.urllib.parse import quote_plus
|
||||||
|
|
||||||
from kodi_six import xbmc, xbmcaddon, xbmcgui, xbmcvfs
|
from kodi_six import xbmc, xbmcaddon, xbmcgui, xbmcvfs
|
||||||
|
|
||||||
|
from . import LazyLogger
|
||||||
from .translate import translate
|
from .translate import translate
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,17 +3,17 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from kodi_six import xbmcgui
|
from kodi_six import xbmcgui
|
||||||
|
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
from .utils import should_stop
|
from .utils import should_stop
|
||||||
from .exceptions import LibraryException
|
from .exceptions import LibraryException
|
||||||
from .translate import translate
|
from .translate import translate
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,17 +3,18 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import xml.etree.ElementTree as etree
|
import xml.etree.ElementTree as etree
|
||||||
|
|
||||||
from kodi_six import xbmc
|
from kodi_six import xbmc
|
||||||
|
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
from . import translate, dialog, settings
|
from . import translate, dialog, settings
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -6,29 +6,15 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from .client import JellyfinClient
|
from .client import JellyfinClient
|
||||||
from helper import has_attribute
|
from helper import has_attribute, LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
LOG = LazyLogger()
|
||||||
class NullHandler(logging.Handler):
|
|
||||||
def emit(self, record):
|
|
||||||
print(self.format(record))
|
|
||||||
|
|
||||||
|
|
||||||
loghandler = NullHandler
|
|
||||||
LOG = logging.getLogger('Jellyfin')
|
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
||||||
def config(level=logging.INFO):
|
|
||||||
|
|
||||||
logger = logging.getLogger('Jellyfin')
|
|
||||||
logger.addHandler(Jellyfin.loghandler())
|
|
||||||
logger.setLevel(level)
|
|
||||||
|
|
||||||
|
|
||||||
def ensure_client():
|
def ensure_client():
|
||||||
|
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
|
@ -61,7 +47,6 @@ class Jellyfin(object):
|
||||||
_shared_state = {}
|
_shared_state = {}
|
||||||
client = {}
|
client = {}
|
||||||
server_id = "default"
|
server_id = "default"
|
||||||
loghandler = loghandler
|
|
||||||
|
|
||||||
def __init__(self, server_id=None):
|
def __init__(self, server_id=None):
|
||||||
self.__dict__ = self._shared_state
|
self.__dict__ = self._shared_state
|
||||||
|
@ -70,16 +55,6 @@ class Jellyfin(object):
|
||||||
def get_client(self):
|
def get_client(self):
|
||||||
return self.client[self.server_id]
|
return self.client[self.server_id]
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def set_loghandler(cls, func=loghandler, level=logging.INFO):
|
|
||||||
|
|
||||||
for handler in logging.getLogger('Jellyfin').handlers:
|
|
||||||
if isinstance(handler, cls.loghandler):
|
|
||||||
logging.getLogger('Jellyfin').removeHandler(handler)
|
|
||||||
|
|
||||||
cls.loghandler = func
|
|
||||||
config(level)
|
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
|
|
||||||
if self.server_id not in self.client:
|
if self.server_id not in self.client:
|
||||||
|
@ -123,6 +98,3 @@ class Jellyfin(object):
|
||||||
LOG.info("---[ START JELLYFINCLIENT ]---")
|
LOG.info("---[ START JELLYFINCLIENT ]---")
|
||||||
else:
|
else:
|
||||||
LOG.info("---[ START JELLYFINCLIENT: %s ]---", self.server_id)
|
LOG.info("---[ START JELLYFINCLIENT: %s ]---", self.server_id)
|
||||||
|
|
||||||
|
|
||||||
config()
|
|
||||||
|
|
|
@ -2,10 +2,12 @@
|
||||||
from __future__ import division, absolute_import, print_function, unicode_literals
|
from __future__ import division, absolute_import, print_function, unicode_literals
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
from helper.utils import settings
|
|
||||||
|
|
||||||
LOG = logging.getLogger('JELLYFIN.' + __name__)
|
from helper.utils import settings
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
|
|
||||||
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def jellyfin_url(client, handler):
|
def jellyfin_url(client, handler):
|
||||||
|
|
|
@ -3,7 +3,7 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
from helper import LazyLogger
|
||||||
|
|
||||||
from . import api
|
from . import api
|
||||||
from .configuration import Config
|
from .configuration import Config
|
||||||
|
@ -13,7 +13,7 @@ from .connection_manager import ConnectionManager, CONNECTION_STATE
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger('JELLYFIN.' + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -7,13 +7,13 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
LOG = LazyLogger(__name__)
|
||||||
DEFAULT_HTTP_MAX_RETRIES = 3
|
DEFAULT_HTTP_MAX_RETRIES = 3
|
||||||
DEFAULT_HTTP_TIMEOUT = 30
|
DEFAULT_HTTP_TIMEOUT = 30
|
||||||
LOG = logging.getLogger('JELLYFIN.' + __name__)
|
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ class Config(object):
|
||||||
self.http()
|
self.http()
|
||||||
|
|
||||||
def app(self, name, version, device_name, device_id, capabilities=None, device_pixel_ratio=None):
|
def app(self, name, version, device_name, device_id, capabilities=None, device_pixel_ratio=None):
|
||||||
|
|
||||||
LOG.debug("Begin app constructor.")
|
LOG.debug("Begin app constructor.")
|
||||||
self.data['app.name'] = name
|
self.data['app.name'] = name
|
||||||
self.data['app.version'] = version
|
self.data['app.version'] = version
|
||||||
|
@ -38,7 +38,7 @@ class Config(object):
|
||||||
self.data['app.default'] = False
|
self.data['app.default'] = False
|
||||||
|
|
||||||
def auth(self, server, user_id, token=None, ssl=None):
|
def auth(self, server, user_id, token=None, ssl=None):
|
||||||
|
|
||||||
LOG.debug("Begin auth constructor.")
|
LOG.debug("Begin auth constructor.")
|
||||||
self.data['auth.server'] = server
|
self.data['auth.server'] = server
|
||||||
self.data['auth.user_id'] = user_id
|
self.data['auth.user_id'] = user_id
|
||||||
|
@ -46,7 +46,7 @@ class Config(object):
|
||||||
self.data['auth.ssl'] = ssl
|
self.data['auth.ssl'] = ssl
|
||||||
|
|
||||||
def http(self, user_agent=None, max_retries=DEFAULT_HTTP_MAX_RETRIES, timeout=DEFAULT_HTTP_TIMEOUT):
|
def http(self, user_agent=None, max_retries=DEFAULT_HTTP_MAX_RETRIES, timeout=DEFAULT_HTTP_TIMEOUT):
|
||||||
|
|
||||||
LOG.debug("Begin http constructor.")
|
LOG.debug("Begin http constructor.")
|
||||||
self.data['http.max_retries'] = max_retries
|
self.data['http.max_retries'] = max_retries
|
||||||
self.data['http.timeout'] = timeout
|
self.data['http.timeout'] = timeout
|
||||||
|
|
|
@ -4,7 +4,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
import socket
|
import socket
|
||||||
import time
|
import time
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
@ -16,10 +15,11 @@ from .credentials import Credentials
|
||||||
from .http import HTTP # noqa: I201,I100
|
from .http import HTTP # noqa: I201,I100
|
||||||
from .api import API
|
from .api import API
|
||||||
import traceback
|
import traceback
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger('JELLYFIN.' + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
CONNECTION_STATE = {
|
CONNECTION_STATE = {
|
||||||
'Unavailable': 0,
|
'Unavailable': 0,
|
||||||
'ServerSelection': 1,
|
'ServerSelection': 1,
|
||||||
|
|
|
@ -3,13 +3,14 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import time
|
import time
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger('JELLYFIN.' + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
@ -12,10 +11,11 @@ from six import string_types
|
||||||
|
|
||||||
from .exceptions import HTTPException
|
from .exceptions import HTTPException
|
||||||
from helper.utils import JsonDebugPrinter
|
from helper.utils import JsonDebugPrinter
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger('Jellyfin.' + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ class HTTP(object):
|
||||||
data['headers'].update({'x-emby-authorization': auth})
|
data['headers'].update({'x-emby-authorization': auth})
|
||||||
|
|
||||||
if self.config.data.get('auth.token') and self.config.data.get('auth.user_id'):
|
if self.config.data.get('auth.token') and self.config.data.get('auth.user_id'):
|
||||||
|
|
||||||
auth += ', UserId=%s' % self.config.data.get('auth.user_id')
|
auth += ', UserId=%s' % self.config.data.get('auth.user_id')
|
||||||
data['headers'].update({'x-emby-authorization': auth, 'X-MediaBrowser-Token': self.config.data.get('auth.token')})
|
data['headers'].update({'x-emby-authorization': auth, 'X-MediaBrowser-Token': self.config.data.get('auth.token')})
|
||||||
|
|
||||||
|
|
|
@ -4,16 +4,17 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from kodi_six import xbmc
|
from kodi_six import xbmc
|
||||||
|
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
from . import websocket
|
from . import websocket
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger('JELLYFIN.' + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import threading
|
import threading
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
|
@ -19,10 +18,11 @@ from downloader import GetItemWorker
|
||||||
from helper import translate, api, stop, settings, window, dialog, event, LibraryException
|
from helper import translate, api, stop, settings, window, dialog, event, LibraryException
|
||||||
from helper.utils import split_list, set_screensaver, get_screensaver
|
from helper.utils import split_list, set_screensaver, get_screensaver
|
||||||
from jellyfin import Jellyfin
|
from jellyfin import Jellyfin
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
LIMIT = int(settings('limitIndex') or 15)
|
LIMIT = int(settings('limitIndex') or 15)
|
||||||
DTHREADS = int(settings('limitThreads') or 3)
|
DTHREADS = int(settings('limitThreads') or 3)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from kodi_six import xbmc
|
from kodi_six import xbmc
|
||||||
|
@ -19,10 +18,11 @@ from helper import translate, settings, window, dialog, api, JSONRPC
|
||||||
from helper.utils import JsonDebugPrinter
|
from helper.utils import JsonDebugPrinter
|
||||||
from jellyfin import Jellyfin
|
from jellyfin import Jellyfin
|
||||||
from webservice import WebService
|
from webservice import WebService
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import threading
|
import threading
|
||||||
import sys
|
import sys
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
@ -15,10 +14,11 @@ from downloader import TheVoid
|
||||||
from .obj import Objects
|
from .obj import Objects
|
||||||
from helper import translate, playutils, api, window, settings, dialog
|
from helper import translate, playutils, api, window, settings, dialog
|
||||||
from dialogs import resume
|
from dialogs import resume
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from six.moves import queue as Queue
|
from six.moves import queue as Queue
|
||||||
|
@ -15,10 +14,11 @@ from . import queries as QU
|
||||||
from . import queries_texture as QUTEX
|
from . import queries_texture as QUTEX
|
||||||
from helper import settings
|
from helper import settings
|
||||||
import requests
|
import requests
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,16 +3,15 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from . import artwork
|
from . import artwork
|
||||||
from . import queries as QU
|
from . import queries as QU
|
||||||
from helper import values
|
from helper import values
|
||||||
from sqlite3 import IntegrityError
|
from sqlite3 import IntegrityError
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,14 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
from helper import LazyLogger
|
||||||
|
|
||||||
from .kodi import Kodi
|
from .kodi import Kodi
|
||||||
from . import queries as QU
|
from . import queries as QU
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,14 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
from helper import LazyLogger
|
||||||
|
|
||||||
from . import queries_music as QU
|
from . import queries_music as QU
|
||||||
from .kodi import Kodi
|
from .kodi import Kodi
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,14 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
from helper import LazyLogger
|
||||||
|
|
||||||
from . import queries as QU
|
from . import queries as QU
|
||||||
from .kodi import Kodi
|
from .kodi import Kodi
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
log = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,14 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
from helper import LazyLogger
|
||||||
|
|
||||||
from . import queries as QU
|
from . import queries as QU
|
||||||
from .kodi import Kodi
|
from .kodi import Kodi
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
from six.moves.urllib.parse import urlencode
|
from six.moves.urllib.parse import urlencode
|
||||||
from kodi_six.utils import py2_encode
|
from kodi_six.utils import py2_encode
|
||||||
|
|
||||||
|
@ -12,10 +11,11 @@ from .obj import Objects
|
||||||
from .kodi import Movies as KodiDb, queries as QU
|
from .kodi import Movies as KodiDb, queries as QU
|
||||||
from database import jellyfin_db, queries as QUEM
|
from database import jellyfin_db, queries as QUEM
|
||||||
from helper import api, stop, validate, jellyfin_item, library_check, values, settings, Local
|
from helper import api, stop, validate, jellyfin_item, library_check, values, settings, Local
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -4,16 +4,16 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
|
||||||
|
|
||||||
from .obj import Objects
|
from .obj import Objects
|
||||||
from .kodi import Music as KodiDb, queries_music as QU
|
from .kodi import Music as KodiDb, queries_music as QU
|
||||||
from database import jellyfin_db, queries as QUEM
|
from database import jellyfin_db, queries as QUEM
|
||||||
from helper import api, stop, validate, jellyfin_item, values, library_check, Local
|
from helper import api, stop, validate, jellyfin_item, values, library_check, Local
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
|
||||||
import re
|
import re
|
||||||
from six.moves.urllib.parse import urlencode
|
from six.moves.urllib.parse import urlencode
|
||||||
from kodi_six.utils import py2_encode
|
from kodi_six.utils import py2_encode
|
||||||
|
@ -13,10 +12,11 @@ from .obj import Objects
|
||||||
from .kodi import MusicVideos as KodiDb, queries as QU
|
from .kodi import MusicVideos as KodiDb, queries as QU
|
||||||
from database import jellyfin_db, queries as QUEM
|
from database import jellyfin_db, queries as QUEM
|
||||||
from helper import api, stop, validate, library_check, jellyfin_item, values, Local
|
from helper import api, stop, validate, library_check, jellyfin_item, values, Local
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,15 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
|
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import sqlite3
|
import sqlite3
|
||||||
from ntpath import dirname
|
from ntpath import dirname
|
||||||
|
|
||||||
|
@ -15,10 +14,11 @@ from .kodi import TVShows as KodiDb, queries as QU
|
||||||
import downloader as server
|
import downloader as server
|
||||||
from database import jellyfin_db, queries as QUEM
|
from database import jellyfin_db, queries as QUEM
|
||||||
from helper import api, stop, validate, jellyfin_item, library_check, settings, values, Local
|
from helper import api, stop, validate, jellyfin_item, library_check, settings, values, Local
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,12 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from helper import JSONRPC
|
from helper import JSONRPC
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from kodi_six import xbmc, xbmcvfs
|
from kodi_six import xbmc, xbmcvfs
|
||||||
|
@ -11,10 +10,11 @@ from kodi_six import xbmc, xbmcvfs
|
||||||
from objects.obj import Objects
|
from objects.obj import Objects
|
||||||
from helper import translate, api, window, settings, dialog, event, silent_catch, JSONRPC
|
from helper import translate, api, window, settings, dialog, event, silent_catch, JSONRPC
|
||||||
from jellyfin import Jellyfin
|
from jellyfin import Jellyfin
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import xml.etree.ElementTree as etree
|
import xml.etree.ElementTree as etree
|
||||||
|
@ -14,10 +13,11 @@ from kodi_six import xbmc, xbmcvfs
|
||||||
from database import Database, jellyfin_db, get_sync, save_sync
|
from database import Database, jellyfin_db, get_sync, save_sync
|
||||||
from helper import translate, api, window, event
|
from helper import translate, api, window, event
|
||||||
from jellyfin import Jellyfin
|
from jellyfin import Jellyfin
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = LazyLogger(__name__)
|
||||||
NODES = {
|
NODES = {
|
||||||
'tvshows': [
|
'tvshows': [
|
||||||
('all', None),
|
('all', None),
|
||||||
|
|
|
@ -4,17 +4,18 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
from six.moves import BaseHTTPServer
|
from six.moves import BaseHTTPServer
|
||||||
import logging
|
|
||||||
from six.moves import http_client as httplib
|
from six.moves import http_client as httplib
|
||||||
import threading
|
import threading
|
||||||
from six.moves.urllib.parse import parse_qsl
|
from six.moves.urllib.parse import parse_qsl
|
||||||
|
|
||||||
from kodi_six import xbmc
|
from kodi_six import xbmc
|
||||||
|
|
||||||
|
from helper import LazyLogger
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
LOG = LazyLogger(__name__)
|
||||||
PORT = 57578
|
PORT = 57578
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import threading
|
import threading
|
||||||
import sys
|
import sys
|
||||||
|
@ -21,10 +20,11 @@ sys.path.insert(0, __base__)
|
||||||
|
|
||||||
from entrypoint import Service # noqa: F402
|
from entrypoint import Service # noqa: F402
|
||||||
from helper.utils import settings # noqa: F402
|
from helper.utils import settings # noqa: F402
|
||||||
|
from helper import LazyLogger # noqa: F402
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN.service")
|
LOG = LazyLogger(__name__)
|
||||||
DELAY = int(settings('startupDelay') if settings('SyncInstallRunDone.bool') else 4 or 0)
|
DELAY = int(settings('startupDelay') if settings('SyncInstallRunDone.bool') else 4 or 0)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue