summaryrefslogtreecommitdiff
path: root/nncmpp.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-10-13 02:03:32 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2016-10-13 02:03:32 +0200
commit62ac29993ec8541d8c9ab0e8f92c7178f2fc5494 (patch)
tree74dfd35b807cae87d13807e9433e0591c45a3c1c /nncmpp.c
parenta8deb3c21877708b022b049dbfb50da58e818108 (diff)
downloadnncmpp-62ac29993ec8541d8c9ab0e8f92c7178f2fc5494.tar.gz
nncmpp-62ac29993ec8541d8c9ab0e8f92c7178f2fc5494.tar.xz
nncmpp-62ac29993ec8541d8c9ab0e8f92c7178f2fc5494.zip
Nicer playlist
Diffstat (limited to 'nncmpp.c')
-rw-r--r--nncmpp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/nncmpp.c b/nncmpp.c
index ba4ffb3..85a39a9 100644
--- a/nncmpp.c
+++ b/nncmpp.c
@@ -1974,8 +1974,15 @@ current_tab_on_item_draw (size_t item_index, struct row_buffer *buffer,
{
// TODO: better output
compact_map_t map = item_list_get (&g_ctx.playlist, item_index);
- row_buffer_append (buffer, compact_map_find (map, "file"),
- (int) item_index == g_ctx.song ? A_BOLD : 0);
+ const char *artist = compact_map_find (map, "artist");
+ const char *title = compact_map_find (map, "title");
+
+ chtype attrs = (int) item_index == g_ctx.song ? A_BOLD : 0;
+ if (artist && title)
+ row_buffer_addv (buffer,
+ artist, attrs, " - ", attrs, title, attrs, NULL);
+ else
+ row_buffer_append (buffer, compact_map_find (map, "file"), attrs);
}
static bool