Type check

main
Bob Mottram 2021-03-09 23:22:48 +00:00
parent 5c18b3b50f
commit 1a66c39656
1 changed files with 6 additions and 4 deletions

View File

@ -147,10 +147,12 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
title = speakerJson['notify']['title'] title = speakerJson['notify']['title']
soundsDir = 'theme/default/sounds' soundsDir = 'theme/default/sounds'
if speakerJson['notify'].get('theme'): if speakerJson['notify'].get('theme'):
soundsDir = \ if isinstance(speakerJson['notify']['theme'], str):
'theme/' + speakerJson['notify']['theme'] + '/sounds' soundsDir = \
if not os.path.isdir(soundsDir): 'theme/' + \
soundsDir = 'theme/default/sounds' speakerJson['notify']['theme'] + '/sounds'
if not os.path.isdir(soundsDir):
soundsDir = 'theme/default/sounds'
if speakerJson['notify']['dm'] != prevDM: if speakerJson['notify']['dm'] != prevDM:
if speakerJson['notify']['dm'] is True: if speakerJson['notify']['dm'] is True:
_playNotificationSound(soundsDir + '/' + _playNotificationSound(soundsDir + '/' +