Plug in dynamic packages

For now, Kodi will need to be restarted to load from the dynamic package every time there is an update to the package.
This commit is contained in:
angelblue05 2018-09-07 03:22:08 -05:00
parent a18fa90f13
commit aac8229f9b
6 changed files with 17 additions and 16 deletions

View File

@ -11,6 +11,8 @@ import xbmcaddon
#################################################################################################
cache = xbmc.translatePath('special://temp/emby').decode('utf-8')
sys.path.insert(0, cache)
__addon__ = xbmcaddon.Addon(id='plugin.video.emby').getAddonInfo('path').decode('utf-8')
__base__ = xbmc.translatePath(os.path.join(__addon__, 'resources', 'lib')).decode('utf-8')
sys.path.append(__base__)

View File

@ -11,6 +11,8 @@ import xbmcaddon
#################################################################################################
cache = xbmc.translatePath('special://temp/emby').decode('utf-8')
sys.path.insert(0, cache)
__addon__ = xbmcaddon.Addon(id='plugin.video.emby').getAddonInfo('path').decode('utf-8')
__base__ = xbmc.translatePath(os.path.join(__addon__, 'resources', 'lib')).decode('utf-8')
sys.path.append(__base__)

View File

@ -11,6 +11,8 @@ import xbmcaddon
#################################################################################################
cache = xbmc.translatePath('special://temp/emby').decode('utf-8')
sys.path.insert(0, cache)
__addon__ = xbmcaddon.Addon(id='plugin.video.emby').getAddonInfo('path').decode('utf-8')
__base__ = xbmc.translatePath(os.path.join(__addon__, 'resources', 'lib')).decode('utf-8')
sys.path.append(__base__)

View File

@ -3,12 +3,10 @@
#################################################################################################
import logging
import sys
import xbmc
import xbmcvfs
import objects
from helper import loghandler
from emby import Emby
@ -20,19 +18,6 @@ LOG = logging.getLogger('EMBY.entrypoint')
#################################################################################################
try:
temp = xbmc.translatePath('special://temp/emby').decode('utf-8')
if not xbmcvfs.exists(temp):
xbmcvfs.mkdir(temp)
sys.path.insert(0, temp)
reload(objects)
except Exception as error:
LOG.error(error)
LOG.warn('No objects not found, using default.')
from default import Events
from service import Service
from context import Context

View File

@ -131,7 +131,7 @@ class Service(xbmc.Monitor):
''' Check for objects build version and compare.
This pulls a dict that contains all the information for the build needed.
'''
LOG.info("--[ check updates ]")
LOG.info("--[ check updates/%s ]", objects.version)
kodi = xbmc.getInfoLabel('System.BuildVersion')
url = "https://sheets.googleapis.com/v4/spreadsheets/1cKWQCVL0lVONulO2KyGzBilzhGvsyuSjFvrqe8g6nJw/values/A2:B?key=AIzaSyAP-1mcBglk9zIofJlqGpvKXkff3GRMhdI"
@ -153,6 +153,9 @@ class Service(xbmc.Monitor):
except Exception as error:
LOG.info(error)
dialog("ok", heading="{emby}", line1=_(33135))
xbmc.executebuiltin('RestartApp')
def onNotification(self, sender, method, data):
''' All notifications are sent via NotifyAll built-in or Kodi.

View File

@ -7,10 +7,17 @@ import os
import sys
import xbmc
import xbmcvfs
import xbmcaddon
#################################################################################################
cache = xbmc.translatePath('special://temp/emby').decode('utf-8')
if not xbmcvfs.exists(cache):
xbmcvfs.mkdir(cache)
sys.path.insert(0, cache)
__addon__ = xbmcaddon.Addon(id='plugin.video.emby').getAddonInfo('path').decode('utf-8')
__base__ = xbmc.translatePath(os.path.join(__addon__, 'resources', 'lib')).decode('utf-8')
sys.path.append(__base__)