Create addondir directory

This allows to make the addon work right away, without a Kodi restart.
Step to eliminate the need to restart Kodi after setting the sources, etc.
This commit is contained in:
angelblue05 2015-03-27 04:53:30 -05:00
parent e9680e3d33
commit 287677f683

View file

@ -55,6 +55,28 @@ def checkKodiSources():
tvLibrary = os.path.join(dataPath,'tvshows') tvLibrary = os.path.join(dataPath,'tvshows')
musicvideoLibrary = os.path.join(dataPath,'musicvideos') musicvideoLibrary = os.path.join(dataPath,'musicvideos')
# If no folder exists at the time, create it.
if xbmcvfs.exists(addondir) == False:
xbmcvfs.mkdir(addondir)
xbmc.log("Manually created %s" % addondir)
if not xbmcvfs.exists(dataPath + os.sep):
xbmcvfs.mkdir(dataPath)
if not xbmcvfs.exists(movieLibrary + os.sep):
xbmcvfs.mkdir(movieLibrary)
addKodiSource("mediabrowser_movies",movieLibrary,"movies")
if not xbmcvfs.exists(tvLibrary + os.sep):
xbmcvfs.mkdir(tvLibrary)
addKodiSource("mediabrowser_tvshows",tvLibrary,"tvshows")
if not xbmcvfs.exists(musicvideoLibrary + os.sep):
xbmcvfs.mkdir(musicvideoLibrary)
addKodiSource("mediabrowser_musicvideos",musicvideoLibrary,"musicvideos")
KodiAdvancedSettingsCheck()
return True
''' To be deleted once fully tested - Angel
rebootRequired = False rebootRequired = False
if not xbmcvfs.exists(dataPath + os.sep): if not xbmcvfs.exists(dataPath + os.sep):
@ -81,7 +103,7 @@ def checkKodiSources():
else: else:
return False return False
return True return True'''
def KodiSQL(): def KodiSQL():
if xbmc.getInfoLabel("System.BuildVersion").startswith("13"): if xbmc.getInfoLabel("System.BuildVersion").startswith("13"):
@ -279,4 +301,4 @@ def stopProfiling(pr, profileName):