Skip to content

Commit 1d053f3

Browse files
authored
Merge pull request #175 from RaeedAhmed/bugfix/notifications
Fix notification setting resetting to 0 Thanks!
2 parents 946a476 + 4d42c8c commit 1d053f3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pyradio/config.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,12 +1947,13 @@ def read_config(self):
19471947
else:
19481948
self.opts['enable_mouse'][1] = True
19491949
elif sp[0] == 'enable_notifications':
1950-
# if not (sp[1] in ('0', '-1')):
1951-
try:
1952-
t = int(int(sp[1]) / 30)
1953-
self.opts['enable_notifications'][1] = str(t * 30)
1954-
except (ValueError, TypeError):
1955-
self.opts['enable_notifications'][1] = '-1'
1950+
self.opts['enable_notifications'][1] = sp[1]
1951+
if sp[1] not in ('0', '-1'):
1952+
try:
1953+
t = int(int(sp[1]) / 30)
1954+
self.opts['enable_notifications'][1] = str(t * 30)
1955+
except (ValueError, TypeError):
1956+
self.opts['enable_notifications'][1] = '-1'
19561957
elif sp[0] == 'confirm_station_deletion':
19571958
if sp[1].lower() == 'false':
19581959
self.opts['confirm_station_deletion'][1] = False

0 commit comments

Comments
 (0)