remove the addon id from the get addon instance call

this should nto be needed and it might be the cause of some werid error messages I am seeing
This commit is contained in:
faush01
2018-03-16 10:18:08 +11:00
parent da44209bc5
commit 283644d333
13 changed files with 31 additions and 29 deletions

View File

@@ -40,7 +40,7 @@ class ClientInformation():
return client_id
def getVersion(self):
addon = xbmcaddon.Addon(id="plugin.video.embycon")
addon = xbmcaddon.Addon()
version = addon.getAddonInfo("version")
return version

View File

@@ -24,7 +24,7 @@ log = SimpleLogging(__name__)
def getDetailsString():
addonSettings = xbmcaddon.Addon(id='plugin.video.embycon')
addonSettings = xbmcaddon.Addon()
include_media = addonSettings.getSetting("include_media") == "true"
include_people = addonSettings.getSetting("include_people") == "true"
include_overview = addonSettings.getSetting("include_overview") == "true"
@@ -46,14 +46,14 @@ class DownloadUtils():
getString = None
def __init__(self, *args):
addon = xbmcaddon.Addon(id='plugin.video.embycon')
addon = xbmcaddon.Addon()
self.addon_name = addon.getAddonInfo('name')
def checkVersion(self):
server_info = {}
activity = {}
try:
settings = xbmcaddon.Addon(id='plugin.video.embycon')
settings = xbmcaddon.Addon()
check_version = settings.getSetting('checkVersion') == 'true'
if check_version == False:
log.debug("Version Check: Not Enabled")
@@ -110,7 +110,7 @@ class DownloadUtils():
log.debug("Version Check Error: SEND: {0}", error)
def getServer(self):
settings = xbmcaddon.Addon(id='plugin.video.embycon')
settings = xbmcaddon.Addon()
host = settings.getSetting('ipaddress')
port = settings.getSetting('port')
if (len(host) == 0) or (host == "<none>") or (len(port) == 0):
@@ -234,7 +234,7 @@ class DownloadUtils():
log.debug("EmbyCon DownloadUtils -> Returning saved UserID: {0}", userid)
return userid
settings = xbmcaddon.Addon('plugin.video.embycon')
settings = xbmcaddon.Addon()
userName = settings.getSetting('username')
if not userName:
@@ -308,7 +308,7 @@ class DownloadUtils():
log.debug("EmbyCon DownloadUtils -> Returning saved AccessToken: {0}", token)
return token
settings = xbmcaddon.Addon('plugin.video.embycon')
settings = xbmcaddon.Addon()
port = settings.getSetting("port")
host = settings.getSetting("ipaddress")
if host is None or host == "" or port is None or port == "":
@@ -356,7 +356,7 @@ class DownloadUtils():
version = clientInfo.getVersion()
client = clientInfo.getClient()
settings = xbmcaddon.Addon('plugin.video.embycon')
settings = xbmcaddon.Addon()
deviceName = settings.getSetting('deviceName')
# remove none ascii chars
deviceName = deviceName.decode("ascii", errors='ignore')
@@ -391,7 +391,7 @@ class DownloadUtils():
log.debug("downloadUrl")
return_data = "null"
settings = xbmcaddon.Addon(id='plugin.video.embycon')
settings = xbmcaddon.Addon()
if settings.getSetting("suppressErrors") == "true":
suppress = True

View File

@@ -33,7 +33,7 @@ import trakttokodi
from item_functions import add_gui_item, extract_item_info, ItemDetails, add_context_menu
__addon__ = xbmcaddon.Addon(id='plugin.video.embycon')
__addon__ = xbmcaddon.Addon()
__addondir__ = xbmc.translatePath(__addon__.getAddonInfo('profile'))
__cwd__ = __addon__.getAddonInfo('path')
PLUGINPATH = xbmc.translatePath(os.path.join(__cwd__))
@@ -50,7 +50,7 @@ dataManager = DataManager()
def mainEntryPoint():
log.debug("===== EmbyCon START =====")
settings = xbmcaddon.Addon(id='plugin.video.embycon')
settings = xbmcaddon.Addon()
profile_code = settings.getSetting('profile') == "true"
pr = None
if (profile_code):
@@ -324,7 +324,7 @@ def getContent(url, params):
log.debug("MediaType: {0}", media_type)
pluginhandle = int(sys.argv[1])
settings = xbmcaddon.Addon(id='plugin.video.embycon')
settings = xbmcaddon.Addon()
# determine view type, map it from media type to view type
viewType = ""
media_type = str(media_type).lower().strip()
@@ -394,7 +394,7 @@ def getContent(url, params):
def processDirectory(results, progress, params):
log.debug("== ENTER: processDirectory ==")
settings = xbmcaddon.Addon(id='plugin.video.embycon')
settings = xbmcaddon.Addon()
server = downloadUtils.getServer()
name_format = params.get("name_format", None)
@@ -549,6 +549,8 @@ def processDirectory(results, progress, params):
return dirItems
@catch_except()
def showMenu(params):
log.debug("showMenu(): {0}", params)
@@ -563,7 +565,7 @@ def showMenu(params):
return
action_items = []
if result["Type"] in ["Episode", "Movie", "Music"]:
li = xbmcgui.ListItem(i18n('play'))
li.setProperty('menu_id', 'play')
@@ -789,7 +791,7 @@ def searchResults(params):
limit = int(params.get('limit', 50))
index = 0
settings = xbmcaddon.Addon(id='plugin.video.embycon')
settings = xbmcaddon.Addon()
server = downloadUtils.getServer()
content_url = ('{server}/emby/Search/Hints?searchTerm=' + query +

View File

@@ -20,7 +20,7 @@ from kodi_utils import HomeWindow
log = SimpleLogging(__name__)
kodi_version = int(xbmc.getInfoLabel('System.BuildVersion')[:2])
addon_instance = xbmcaddon.Addon(id='plugin.video.embycon')
addon_instance = xbmcaddon.Addon()
addon_path = addon_instance.getAddonInfo('path')
PLUGINPATH = xbmc.translatePath(os.path.join(addon_path))

View File

@@ -9,7 +9,7 @@ import json
from simple_logging import SimpleLogging
log = SimpleLogging(__name__)
addon = xbmcaddon.Addon(id='plugin.video.embycon')
addon = xbmcaddon.Addon()
class HomeWindow():
"""

View File

@@ -18,7 +18,7 @@ from datamanager import DataManager
log = SimpleLogging(__name__)
downloadUtils = DownloadUtils()
__addon__ = xbmcaddon.Addon(id='plugin.video.embycon')
__addon__ = xbmcaddon.Addon()
def showGenreList(params):
@@ -90,7 +90,7 @@ def showGenreList(params):
def showMovieAlphaList():
log.debug("== ENTER: showMovieAlphaList() ==")
settings = xbmcaddon.Addon(id='plugin.video.embycon')
settings = xbmcaddon.Addon()
server = downloadUtils.getServer()
if server is None:
return

View File

@@ -123,7 +123,7 @@ def playFile(play_info, monitor):
log.debug("playFile id({0}) resume({1}) force_transcode({2})", id, auto_resume, force_transcode)
settings = xbmcaddon.Addon('plugin.video.embycon')
settings = xbmcaddon.Addon()
addon_path = settings.getAddonInfo('path')
force_auto_resume = settings.getSetting('forceAutoResume') == 'true'
jump_back_amount = int(settings.getSetting("jump_back_amount"))
@@ -630,7 +630,7 @@ def sendProgress(monitor):
@catch_except()
def promptForStopActions(item_id, current_possition):
settings = xbmcaddon.Addon(id='plugin.video.embycon')
settings = xbmcaddon.Addon()
prompt_next_percentage = int(settings.getSetting('promptPlayNextEpisodePercentage'))
play_prompt = settings.getSetting('promptPlayNextEpisodePercentage_prompt') == "true"
@@ -744,7 +744,7 @@ class Service(xbmc.Player):
self.activity = {}
def save_activity(self):
addon = xbmcaddon.Addon(id='plugin.video.embycon')
addon = xbmcaddon.Addon()
path = xbmc.translatePath(addon.getAddonInfo('profile')) + "activity.json"
activity_data = json.dumps(self.activity)
f = xbmcvfs.File(path, 'w')

View File

@@ -15,7 +15,7 @@ from translation import i18n
log = SimpleLogging(__name__)
__addon__ = xbmcaddon.Addon(id='plugin.video.embycon')
__addon__ = xbmcaddon.Addon()
__addon_name__ = __addon__.getAddonInfo('name')
downloadUtils = DownloadUtils()
@@ -59,7 +59,7 @@ def getServerDetails():
def checkServer(force=False, change_user=False, notify=False):
log.debug("checkServer Called")
settings = xbmcaddon.Addon(id='plugin.video.embycon')
settings = xbmcaddon.Addon()
serverUrl = ""
if force is False:

View File

@@ -11,7 +11,7 @@ class SimpleLogging():
enable_logging = False
def __init__(self, name):
settings = xbmcaddon.Addon(id='plugin.video.embycon')
settings = xbmcaddon.Addon()
prefix = settings.getAddonInfo('name')
self.name = prefix + '.' + name
params = {"setting": "debug.showloginfo"}

View File

@@ -3,7 +3,7 @@ import xbmcaddon
from simple_logging import SimpleLogging
log = SimpleLogging(__name__)
addon = xbmcaddon.Addon(id='plugin.video.embycon')
addon = xbmcaddon.Addon()
def i18n(string_id):

View File

@@ -30,7 +30,7 @@ log = SimpleLogging(__name__)
class PlayUtils():
def getPlayUrl(self, id, media_source, force_transcode, play_session_id):
log.debug("getPlayUrl")
addonSettings = xbmcaddon.Addon(id='plugin.video.embycon')
addonSettings = xbmcaddon.Addon()
playback_type = addonSettings.getSetting("playback_type")
server = downloadUtils.getServer()
log.debug("playback_type: {0}", playback_type)

View File

@@ -234,7 +234,7 @@ def populateWidgetItems(itemsUrl, override_select_action=None):
if server is None:
return []
settings = xbmcaddon.Addon(id='plugin.video.embycon')
settings = xbmcaddon.Addon()
select_action = settings.getSetting("widget_select_action")
if override_select_action is not None:

View File

@@ -49,7 +49,7 @@ websocket_client = WebSocketClient()
home_window.setProperty("session_id", str(time.time()))
# start the WebSocket Client running
settings = xbmcaddon.Addon(id='plugin.video.embycon')
settings = xbmcaddon.Addon()
remote_control = settings.getSetting('remoteControl') == "true"
if remote_control:
websocket_client.start()