skip a loop instead of exploding when stuff isn't playing
This commit is contained in:
parent
30b43d3c73
commit
eeaa90724d
1 changed files with 4 additions and 0 deletions
|
|
@ -48,7 +48,11 @@ while True:
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
continue
|
continue
|
||||||
|
if not out:
|
||||||
|
continue
|
||||||
id, state, artist, song, album, duration, album_artist = out
|
id, state, artist, song, album, duration, album_artist = out
|
||||||
|
if hasattr(duration, "code"):
|
||||||
|
continue
|
||||||
print(f"{runtime}/{round(duration)}", end="\r")
|
print(f"{runtime}/{round(duration)}", end="\r")
|
||||||
if old_id != id:
|
if old_id != id:
|
||||||
print("new song", old_id, id, song)
|
print("new song", old_id, id, song)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue