Fix TypeError with AdvancedSettings.xml missing

- Fixes #290
This commit is contained in:
tomkat83 2017-05-07 13:42:46 +02:00
parent 43e894ae1f
commit acfb9d4128
2 changed files with 8 additions and 6 deletions

View file

@ -401,12 +401,13 @@ class InitialSetup():
dialog = self.dialog
# Get current Kodi video cache setting
cache, _ = advancedsettings_xml(['cache', 'memorysize'])
if cache is not None:
cache = str(cache.text)
else:
try:
cache, _ = advancedsettings_xml(['cache', 'memorysize'])
except TypeError:
# Kodi default cache
cache = '20971520'
else:
cache = str(cache.text)
log.info('Current Kodi video memory cache in bytes: %s' % cache)
settings('kodi_video_cache', value=cache)

View file

@ -21,8 +21,9 @@ def get_current_music_folders():
excludefromscan music folders in the advancedsettings.xml
"""
paths = []
root, _ = advancedsettings_xml(['audio', 'excludefromscan'])
if root is None:
try:
root, _ = advancedsettings_xml(['audio', 'excludefromscan'])
except TypeError:
return paths
for element in root: