parent
d93850228a
commit
722c3c1821
4 changed files with 19 additions and 18 deletions
|
@ -401,9 +401,8 @@ class InitialSetup():
|
||||||
dialog = self.dialog
|
dialog = self.dialog
|
||||||
|
|
||||||
# Get current Kodi video cache setting
|
# Get current Kodi video cache setting
|
||||||
try:
|
|
||||||
cache, _ = advancedsettings_xml(['cache', 'memorysize'])
|
cache, _ = advancedsettings_xml(['cache', 'memorysize'])
|
||||||
except TypeError:
|
if cache is None:
|
||||||
# Kodi default cache
|
# Kodi default cache
|
||||||
cache = '20971520'
|
cache = '20971520'
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -297,15 +297,6 @@ class LibrarySync(Thread):
|
||||||
}
|
}
|
||||||
if self.enableMusic:
|
if self.enableMusic:
|
||||||
process['music'] = self.PlexMusic
|
process['music'] = self.PlexMusic
|
||||||
if self.direct_paths is True:
|
|
||||||
if music.set_excludefromscan_music_folders() is True:
|
|
||||||
log.info('Detected new Music library - restarting now')
|
|
||||||
# 'New Plex music library detected. Sorry, but we need to
|
|
||||||
# restart Kodi now due to the changes made.'
|
|
||||||
dialog('ok', lang(29999), lang(39711))
|
|
||||||
from xbmc import executebuiltin
|
|
||||||
executebuiltin('RestartApp')
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Do the processing
|
# Do the processing
|
||||||
for itemtype in process:
|
for itemtype in process:
|
||||||
|
@ -483,6 +474,16 @@ class LibrarySync(Thread):
|
||||||
"""
|
"""
|
||||||
Compare the views to Plex
|
Compare the views to Plex
|
||||||
"""
|
"""
|
||||||
|
if self.direct_paths is True:
|
||||||
|
if music.set_excludefromscan_music_folders() is True:
|
||||||
|
log.info('Detected new Music library - restarting now')
|
||||||
|
# 'New Plex music library detected. Sorry, but we need to
|
||||||
|
# restart Kodi now due to the changes made.'
|
||||||
|
dialog('ok', lang(29999), lang(39711))
|
||||||
|
from xbmc import executebuiltin
|
||||||
|
executebuiltin('RestartApp')
|
||||||
|
return False
|
||||||
|
|
||||||
self.views = []
|
self.views = []
|
||||||
vnodes = self.vnodes
|
vnodes = self.vnodes
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,8 @@ def get_current_music_folders():
|
||||||
excludefromscan music folders in the advancedsettings.xml
|
excludefromscan music folders in the advancedsettings.xml
|
||||||
"""
|
"""
|
||||||
paths = []
|
paths = []
|
||||||
try:
|
|
||||||
root, _ = advancedsettings_xml(['audio', 'excludefromscan'])
|
root, _ = advancedsettings_xml(['audio', 'excludefromscan'])
|
||||||
except TypeError:
|
if root is None:
|
||||||
return paths
|
return paths
|
||||||
|
|
||||||
for element in root:
|
for element in root:
|
||||||
|
|
|
@ -542,8 +542,10 @@ def __setSubElement(element, subelement):
|
||||||
def advancedsettings_xml(node_list, new_value=None, attrib=None,
|
def advancedsettings_xml(node_list, new_value=None, attrib=None,
|
||||||
force_create=False):
|
force_create=False):
|
||||||
"""
|
"""
|
||||||
Returns the etree element for nodelist (if it exists) and the tree. None if
|
Returns
|
||||||
not set
|
etree element, tree
|
||||||
|
or
|
||||||
|
None, None
|
||||||
|
|
||||||
node_list is a list of node names starting from the outside, ignoring the
|
node_list is a list of node names starting from the outside, ignoring the
|
||||||
outter advancedsettings. Example nodelist=['video', 'busydialogdelayms']
|
outter advancedsettings. Example nodelist=['video', 'busydialogdelayms']
|
||||||
|
@ -576,7 +578,7 @@ def advancedsettings_xml(node_list, new_value=None, attrib=None,
|
||||||
# Document is blank or missing
|
# Document is blank or missing
|
||||||
if new_value is None and attrib is None and force_create is False:
|
if new_value is None and attrib is None and force_create is False:
|
||||||
log.debug('Could not parse advancedsettings.xml, returning None')
|
log.debug('Could not parse advancedsettings.xml, returning None')
|
||||||
return
|
return None, None
|
||||||
# Create topmost xml entry
|
# Create topmost xml entry
|
||||||
tree = etree.ElementTree(element=etree.Element('advancedsettings'))
|
tree = etree.ElementTree(element=etree.Element('advancedsettings'))
|
||||||
root = tree.getroot()
|
root = tree.getroot()
|
||||||
|
|
Loading…
Reference in a new issue