diff --git a/software/webradio.py b/software/webradio.py index 8bd5a9c..c0f27ec 100644 --- a/software/webradio.py +++ b/software/webradio.py @@ -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):