Fix bug that caused crash when no sound was selected
This commit is contained in:
parent
ab2906b1a6
commit
8d38e81a95
11
clock.py
11
clock.py
|
@ -393,12 +393,11 @@ class MyClockWidget(FloatLayout):
|
||||||
if alarm_settings.alarm_activated == False:
|
if alarm_settings.alarm_activated == False:
|
||||||
return
|
return
|
||||||
|
|
||||||
if alarm_settings.sound_source == "":
|
if self.seconds_to_next_alarm < 0.1:
|
||||||
return
|
print("Rise and shine baby!" + str(alarm_settings.sound_source))
|
||||||
|
if alarm_settings.sound_source != "" and sound_process is None:
|
||||||
if self.seconds_to_next_alarm < 0.1 and sound_process is None:
|
sound_process = Process(target=play_sound, args=(alarm_settings.sound_source,))
|
||||||
sound_process = Process(target=play_sound, args=(alarm_settings.sound_source,))
|
sound_process.start()
|
||||||
sound_process.start()
|
|
||||||
|
|
||||||
def calc_seconds_to_next_alarm(self):
|
def calc_seconds_to_next_alarm(self):
|
||||||
alarm_settings = App.get_running_app().alarm_settings
|
alarm_settings = App.get_running_app().alarm_settings
|
||||||
|
|
Loading…
Reference in New Issue