diff options
-rw-r--r-- | src/screen_browser.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/screen_browser.c b/src/screen_browser.c index b9ef7d4e7..f3ec8eda6 100644 --- a/src/screen_browser.c +++ b/src/screen_browser.c @@ -358,14 +358,11 @@ browser_select_entry(mpdclient_t *c, filelist_entry_t *entry, if (entry->entity->type != MPD_INFO_ENTITY_TYPE_SONG) return -1; - if (toggle && entry->flags & HIGHLIGHT) - entry->flags &= ~HIGHLIGHT; - else - entry->flags |= HIGHLIGHT; - - if (toggle || entry->flags & HIGHLIGHT) { + if (!toggle || (entry->flags & HIGHLIGHT) == 0) { mpd_Song *song = entry->entity->info.song; + entry->flags |= HIGHLIGHT; + if (mpdclient_cmd_add(c, song) == 0) { char buf[BUFSIZE]; @@ -376,6 +373,8 @@ browser_select_entry(mpdclient_t *c, filelist_entry_t *entry, /* remove song from playlist */ mpd_Song *song = entry->entity->info.song; + entry->flags &= ~HIGHLIGHT; + if (song) { int idx; |