Change to xbmcvfs mkdirs

This commit is contained in:
tomkat83 2017-05-11 17:51:14 +02:00
parent 4eb2e5a08c
commit 216159d96c
4 changed files with 13 additions and 10 deletions

View file

@ -40,10 +40,10 @@ from re import compile as re_compile, sub
from json import dumps from json import dumps
from urllib import urlencode, quote_plus, unquote from urllib import urlencode, quote_plus, unquote
from os.path import basename, join, exists from os.path import basename, join, exists
from os import makedirs
import xbmcgui import xbmcgui
from xbmc import sleep, executebuiltin from xbmc import sleep, executebuiltin
from xbmcvfs import mkdirs
import clientinfo as client import clientinfo as client
from downloadutils import DownloadUtils from downloadutils import DownloadUtils
@ -2345,7 +2345,7 @@ class API():
Returns the path to the downloaded subtitle or None Returns the path to the downloaded subtitle or None
""" """
if not exists(v.EXTERNAL_SUBTITLE_TEMP_PATH): if not exists(v.EXTERNAL_SUBTITLE_TEMP_PATH):
makedirs(v.EXTERNAL_SUBTITLE_TEMP_PATH) mkdirs(v.EXTERNAL_SUBTITLE_TEMP_PATH)
path = join(v.EXTERNAL_SUBTITLE_TEMP_PATH, filename) path = join(v.EXTERNAL_SUBTITLE_TEMP_PATH, filename)
r = DownloadUtils().downloadUrl(url, return_response=True) r = DownloadUtils().downloadUrl(url, return_response=True)
try: try:

View file

@ -2,7 +2,7 @@
############################################################################### ###############################################################################
import logging import logging
from shutil import copyfile from shutil import copyfile
from os import walk, makedirs from os import walk
from os.path import basename, join, exists from os.path import basename, join, exists
from sys import argv from sys import argv
from urllib import urlencode from urllib import urlencode
@ -10,6 +10,7 @@ from urllib import urlencode
import xbmcplugin import xbmcplugin
from xbmc import sleep, executebuiltin, translatePath from xbmc import sleep, executebuiltin, translatePath
from xbmcgui import ListItem from xbmcgui import ListItem
from xbmcvfs import mkdirs
from utils import window, settings, language as lang, dialog, tryEncode, \ from utils import window, settings, language as lang, dialog, tryEncode, \
CatchExceptions, JSONRPC CatchExceptions, JSONRPC
@ -538,7 +539,7 @@ def getExtraFanArt(plexid, plexPath):
fanartDir = translatePath("special://thumbnails/plex/%s/" % plexid) fanartDir = translatePath("special://thumbnails/plex/%s/" % plexid)
if not exists(fanartDir): if not exists(fanartDir):
# Download the images to the cache directory # Download the images to the cache directory
makedirs(fanartDir) mkdirs(fanartDir)
xml = GetPlexMetadata(plexid) xml = GetPlexMetadata(plexid)
if xml is None: if xml is None:
log.error('Could not download metadata for %s' % plexid) log.error('Could not download metadata for %s' % plexid)

View file

@ -13,14 +13,15 @@ from unicodedata import normalize
import xml.etree.ElementTree as etree import xml.etree.ElementTree as etree
from functools import wraps from functools import wraps
from calendar import timegm from calendar import timegm
from os.path import exists, join from os.path import join
from os import remove, makedirs, walk from os import remove, walk
from shutil import rmtree from shutil import rmtree
from urllib import quote_plus from urllib import quote_plus
import xbmc import xbmc
import xbmcaddon import xbmcaddon
import xbmcgui import xbmcgui
from xbmcvfs import exists as kodi_exists, mkdirs
from variables import DB_VIDEO_PATH, DB_MUSIC_PATH, DB_TEXTURE_PATH, \ from variables import DB_VIDEO_PATH, DB_MUSIC_PATH, DB_TEXTURE_PATH, \
DB_PLEX_PATH, KODI_PROFILE DB_PLEX_PATH, KODI_PROFILE
@ -784,7 +785,7 @@ def playlistXSP(mediatype, tagname, viewid, viewtype="", delete=False):
# Create the playlist directory # Create the playlist directory
if not exists(path): if not exists(path):
log.info("Creating directory: %s" % path) log.info("Creating directory: %s" % path)
makedirs(path) mkdirs(path)
# Only add the playlist if it doesn't already exists # Only add the playlist if it doesn't already exists
if exists(xsppath): if exists(xsppath):

View file

@ -3,10 +3,11 @@
import logging import logging
from shutil import copytree from shutil import copytree
import xml.etree.ElementTree as etree import xml.etree.ElementTree as etree
from os import remove, listdir
from os.path import exists, isfile, join
import xbmc import xbmc
from os import remove, makedirs, listdir from xbmcvfs import mkdirs
from os.path import exists, isfile, join
from utils import window, settings, language as lang, tryEncode, indent, \ from utils import window, settings, language as lang, tryEncode, indent, \
normalize_nodes normalize_nodes
@ -84,7 +85,7 @@ class VideoNodes(object):
if exists(nodepath) is False: if exists(nodepath) is False:
# folder does not exist yet # folder does not exist yet
log.debug('Creating folder %s' % nodepath) log.debug('Creating folder %s' % nodepath)
makedirs(nodepath) mkdirs(nodepath)
# Create index entry # Create index entry
nodeXML = "%sindex.xml" % nodepath nodeXML = "%sindex.xml" % nodepath