cfangmeier / tuijam

A fancy TUI client for Google Play Music
MIT License
129 stars 9 forks source link

Crash during refresh #10

Closed cfangmeier closed 5 years ago

cfangmeier commented 6 years ago

Since the end-of-song callback performs asynchronously with the now-playing-update one, what seems to sometimes happen is that the now-playing callback starts executing and sees that there is a current song. Then, it gets interrupted by the end-of-song callback which sets the current song to None if there are no more songs left in the queue. The now-playing callback resumes, but now the current song is None which causes a TypeError when its attributes are accessed.

cfangmeier commented 5 years ago

9003eae changes the mpv end-of-song callback to set a flag and schedule a refresh instead of editing state directly. This should fix this problem.