Fix Library Sync crash for Android

- Caused by PKC wanting to copy permissions bits as well
This commit is contained in:
Croneter 2018-06-09 12:56:21 +02:00
parent 69b8e98b39
commit 15f3313c1f

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################### ###############################################################################
from logging import getLogger from logging import getLogger
from shutil import copytree from distutils import dir_util
import xml.etree.ElementTree as etree import xml.etree.ElementTree as etree
from os import makedirs from os import makedirs
@ -77,11 +77,10 @@ class VideoNodes(object):
# Verify the video directory # Verify the video directory
if not exists_dir(path): if not exists_dir(path):
copytree( dir_util.copy_tree(
src=try_decode(xbmc.translatePath( src=xbmc.translatePath("special://xbmc/system/library/video"),
"special://xbmc/system/library/video")), dst=xbmc.translatePath("special://profile/library/video"),
dst=try_decode(xbmc.translatePath( preserve_mode=0) # do not copy permission bits!
"special://profile/library/video")))
# Create the node directory # Create the node directory
if mediatype != "photos": if mediatype != "photos":
@ -394,11 +393,10 @@ class VideoNodes(object):
# Create the video node directory # Create the video node directory
if not exists_dir(nodepath): if not exists_dir(nodepath):
# We need to copy over the default items # We need to copy over the default items
copytree( dir_util.copy_tree(
src=try_decode(xbmc.translatePath( src=xbmc.translatePath("special://xbmc/system/library/video"),
"special://xbmc/system/library/video")), dst=xbmc.translatePath("special://profile/library/video"),
dst=try_decode(xbmc.translatePath( preserve_mode=0) # do not copy permission bits!
"special://profile/library/video")))
labels = { labels = {
'Favorite movies': 30180, 'Favorite movies': 30180,