summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 860824f)
raw | patch | inline | side by side (parent: 860824f)
author | Max Kellermann <max@duempel.org> | |
Thu, 18 Sep 2008 21:35:12 +0000 (23:35 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 18 Sep 2008 21:35:12 +0000 (23:35 +0200) |
The function browser_select_entry() returns early when the entity type
is not "SONG". No need to double check that.
is not "SONG". No need to double check that.
src/screen_browser.c | patch | blob | history |
diff --git a/src/screen_browser.c b/src/screen_browser.c
index 8e899fcbffe398409d346fe556485b99e4f6a188..b9ef7d4e734cc87f09c714ec235d3080cf2b8090 100644 (file)
--- a/src/screen_browser.c
+++ b/src/screen_browser.c
entry->flags |= HIGHLIGHT;
if (toggle || entry->flags & HIGHLIGHT) {
- if (entry->entity->type == MPD_INFO_ENTITY_TYPE_SONG) {
- mpd_Song *song = entry->entity->info.song;
+ mpd_Song *song = entry->entity->info.song;
- if (mpdclient_cmd_add(c, song) == 0) {
- char buf[BUFSIZE];
+ if (mpdclient_cmd_add(c, song) == 0) {
+ char buf[BUFSIZE];
- strfsong(buf, BUFSIZE, LIST_FORMAT, song);
- screen_status_printf(_("Adding \'%s\' to playlist\n"), buf);
- }
+ strfsong(buf, BUFSIZE, LIST_FORMAT, song);
+ screen_status_printf(_("Adding \'%s\' to playlist\n"), buf);
}
} else {
/* remove song from playlist */
- if (entry->entity->type == MPD_INFO_ENTITY_TYPE_SONG) {
- mpd_Song *song = entry->entity->info.song;
+ mpd_Song *song = entry->entity->info.song;
- if (song) {
- int idx;
+ if (song) {
+ int idx;
- while ((idx = playlist_get_index_from_file(c, song->file)) >=0)
- mpdclient_cmd_delete(c, idx);
- }
+ while ((idx = playlist_get_index_from_file(c, song->file)) >=0)
+ mpdclient_cmd_delete(c, idx);
}
}