From dbf6a350c72375f4caad047aa012ec0a0ddbbb45 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Fri, 23 Oct 2015 02:21:12 -0500 Subject: [PATCH] Fix direct path By the time the initial setup went thru, the class was already loaded. Instead, load the settings in the instance. --- resources/lib/WriteKodiMusicDB.py | 11 +++++------ resources/lib/WriteKodiVideoDB.py | 13 +++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/resources/lib/WriteKodiMusicDB.py b/resources/lib/WriteKodiMusicDB.py index c82f637f..c8570341 100644 --- a/resources/lib/WriteKodiMusicDB.py +++ b/resources/lib/WriteKodiMusicDB.py @@ -27,13 +27,12 @@ class WriteKodiMusicDB(): kodiversion = int(xbmc.getInfoLabel("System.BuildVersion")[:2]) addonName = ClientInformation().getAddonName() - WINDOW = xbmcgui.Window(10000) - username = WINDOW.getProperty('currUser') - userid = WINDOW.getProperty('userId%s' % username) - server = WINDOW.getProperty('server%s' % username) - - directpath = utils.settings('useDirectPaths') == "true" + def __init__(self): + + username = utils.window('currUser') + self.userid = utils.window('userId%s' % username) + self.server = utils.window('server%s' % username) def logMsg(self, msg, lvl = 1): diff --git a/resources/lib/WriteKodiVideoDB.py b/resources/lib/WriteKodiVideoDB.py index a2d6e081..e0bb557b 100644 --- a/resources/lib/WriteKodiVideoDB.py +++ b/resources/lib/WriteKodiVideoDB.py @@ -27,13 +27,14 @@ class WriteKodiVideoDB(): kodiversion = int(xbmc.getInfoLabel("System.BuildVersion")[:2]) addonName = ClientInformation().getAddonName() - WINDOW = xbmcgui.Window(10000) + + def __init__(self): - username = WINDOW.getProperty('currUser') - userid = WINDOW.getProperty('userId%s' % username) - server = WINDOW.getProperty('server%s' % username) - - directpath = utils.settings('useDirectPaths') == "true" + username = utils.window('currUser') + self.userid = utils.window('userId%s' % username) + self.server = utils.window('server%s' % username) + + self.directpath = utils.settings('useDirectPaths') == "true" def logMsg(self, msg, lvl = 1):