GuardKenzie / miniplayer

A curses based mpd client with basic functionality and album art.
MIT License
120 stars 8 forks source link

Repeat text always shows up when miniplayer is started and is not updated if changed outside miniplayer #27

Closed vide0hanz closed 2 years ago

vide0hanz commented 2 years ago

I've notced that when I launch miniplayer, the repeat_string is displayed in the bottom left corner, suggesting that repeat has been toggled on. This doesn't appear to have any real effect, however. Any idea what might be causing this string to be displayed when launched?

Looking at lines 230-237 seem to suggest a check if repeat mode is enabled by the MPD client and to reflect as much in Miniplayer.

I've checked to see if changes are indeed being made to the client by having miniplayer and ncmpcpp open at the same time - if I have focus on ncmpcpp and press the 'r' key, nothing happens to miniplayer yet oddly enough, when I toggle the 'r' key on miniplayer, both windows indicate a message telling me repeat mode is active.

Not sure if this is a bug or a faulty configuration on my end, but I can't seem to narrow it down if it is the latter case.

GuardKenzie commented 2 years ago

This is a bug. Apparently MPDClient.status() returns a dictionary where all the values are strings not integers like I thought. This results in the repeat state to be initialized as true whether or not it is actually enabled.

In regards to the ncmpcpp thing, that is just lazy programing on my part. The repeat state is not checked/updated after miniplayer is launched unless the user issues the "repeat" keyboard command.

I will take a look at both these issues sometime next week when I'm off my vacation.

Edit

Nevermind, this was an easy fix!