Fix emby connect

This commit is contained in:
angelblue05 2016-10-14 02:04:59 -05:00
parent 8086927673
commit 3f3ac45ef5
2 changed files with 22 additions and 18 deletions

View file

@ -35,14 +35,12 @@ class ConnectManager(object):
self.__dict__ = self._shared_state self.__dict__ = self._shared_state
if not self.state and not window('emby_currUser'):
client_info = clientinfo.ClientInfo() client_info = clientinfo.ClientInfo()
self.emby = embyserver.Read_EmbyServer() self.emby = embyserver.Read_EmbyServer()
version = client_info.get_version() version = client_info.get_version()
device_name = client_info.get_device_name() device_name = client_info.get_device_name()
device_id = client_info.get_device_id() device_id = client_info.get_device_id()
self._connect = connectionmanager.ConnectionManager(appName="Kodi", self._connect = connectionmanager.ConnectionManager(appName="Kodi",
appVersion=version, appVersion=version,
deviceName=device_name, deviceName=device_name,
@ -54,16 +52,22 @@ class ConnectManager(object):
xbmcvfs.mkdirs(path) xbmcvfs.mkdirs(path)
self._connect.setFilePath(path) self._connect.setFilePath(path)
if window('emby_state.json'):
self.state = window('emby_state.json')
elif not self.state:
self.state = self._connect.connect() self.state = self._connect.connect()
log.info("Started with: %s", self.state) log.info("Started with: %s", self.state)
window('emby_state.json', value=self.state)
def update_state(self): def update_state(self):
self.state = self._connect.connect({'updateDateLastAccessed': False}) self.state = self._connect.connect({'updateDateLastAccessed': False})
return self.state return self.get_state()
def get_state(self): def get_state(self):
window('emby_state.json', value=self.state)
return self.state return self.state
def get_server(self, server): def get_server(self, server):

View file

@ -67,7 +67,7 @@ class Service(object):
# Reset window props for profile switch # Reset window props for profile switch
properties = [ properties = [
"emby_online", "emby_serverStatus", "emby_onWake", "emby_online", "emby_state.json" "emby_serverStatus", "emby_onWake",
"emby_syncRunning", "emby_dbCheck", "emby_kodiScan", "emby_syncRunning", "emby_dbCheck", "emby_kodiScan",
"emby_shouldStop", "emby_currUser", "emby_dbScan", "emby_sessionId", "emby_shouldStop", "emby_currUser", "emby_dbScan", "emby_sessionId",
"emby_initialScan", "emby_customplaylist", "emby_playbackProps" "emby_initialScan", "emby_customplaylist", "emby_playbackProps"