sw: Allow empty duration
This commit is contained in:
parent
7efac00348
commit
a8d947544b
@ -179,8 +179,11 @@ class radioserv:
|
||||
# Playback info
|
||||
try:
|
||||
cm, cs = divmod(round(float(status['elapsed'])), 60)
|
||||
dm, ds = divmod(round(float(status['duration'])), 60)
|
||||
info = "#%d/%d %d:%02d/%d:%02d" % (int(status['song']) + 1, int(status['playlistlength']), cm, cs, dm, ds)
|
||||
if "duration" in status:
|
||||
dm, ds = divmod(round(float(status['duration'])), 60)
|
||||
info = "#%d/%d %d:%02d/%d:%02d" % (int(status['song']) + 1, int(status['playlistlength']), cm, cs, dm, ds)
|
||||
else:
|
||||
info = "Radio %02d:%02d" % (cm, cs)
|
||||
except:
|
||||
info = "Stopped"
|
||||
if (info != last_info):
|
||||
|
Loading…
Reference in New Issue
Block a user