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 dialog = self.dialog
# Get current Kodi video cache setting # Get current Kodi video cache setting
cache, _ = advancedsettings_xml(['cache', 'memorysize']) try:
if cache is not None: cache, _ = advancedsettings_xml(['cache', 'memorysize'])
cache = str(cache.text) except TypeError:
else:
# Kodi default cache # Kodi default cache
cache = '20971520' cache = '20971520'
else:
cache = str(cache.text)
log.info('Current Kodi video memory cache in bytes: %s' % cache) log.info('Current Kodi video memory cache in bytes: %s' % cache)
settings('kodi_video_cache', value=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 excludefromscan music folders in the advancedsettings.xml
""" """
paths = [] paths = []
root, _ = advancedsettings_xml(['audio', 'excludefromscan']) try:
if root is None: root, _ = advancedsettings_xml(['audio', 'excludefromscan'])
except TypeError:
return paths return paths
for element in root: for element in root: