Fix unexistant directory crash

For saving data.txt for the connect module
This commit is contained in:
angelblue05 2016-09-11 03:12:45 -05:00
parent cd602dd94a
commit 6a5399a3a8

View file

@ -6,6 +6,7 @@ import logging
import xbmc import xbmc
import xbmcaddon import xbmcaddon
import xbmcvfs
import clientinfo import clientinfo
import read_embyserver as embyserver import read_embyserver as embyserver
@ -43,8 +44,13 @@ class ConnectManager(object):
appVersion=version, appVersion=version,
deviceName=device_name, deviceName=device_name,
deviceId=device_id) deviceId=device_id)
self._connect.setFilePath(xbmc.translatePath( path = xbmc.translatePath(
"special://profile/addon_data/plugin.video.emby/").decode('utf-8')) "special://profile/addon_data/plugin.video.emby/").decode('utf-8')
if not xbmcvfs.exists(path):
xbmcvfs.mkdirs(path)
self._connect.setFilePath(path)
self.state = self._connect.connect() self.state = self._connect.connect()
log.info("Started with: %s", self.state) log.info("Started with: %s", self.state)