From 8121046be6133d25e03b59eb5a68fa1e4f6db806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Sat, 24 Oct 2020 14:46:40 +0200 Subject: [PATCH] Skip playlists in lsinfo responses Instead of merging the fields into other items. --- nncmpp.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/nncmpp.c b/nncmpp.c index 12e4c6a..a1f6bcf 100644 --- a/nncmpp.c +++ b/nncmpp.c @@ -2410,10 +2410,11 @@ enum { // This list is also ordered by ASCII and important for sorting - LIBRARY_ROOT = '/', ///< Root entry - LIBRARY_UP = '^', ///< Upper directory - LIBRARY_DIR = 'd', ///< Directory - LIBRARY_FILE = 'f' ///< File + LIBRARY_ROOT = '/', ///< Root entry + LIBRARY_UP = '^', ///< Upper directory + LIBRARY_DIR = 'd', ///< Directory + LIBRARY_FILE = 'f', ///< File + LIBRARY_PLAYLIST = 'p', ///< Playlist (unsupported) }; struct library_tab_item @@ -2482,12 +2483,18 @@ library_tab_header_type (const char *key) { if (!strcasecmp_ascii (key, "file")) return LIBRARY_FILE; if (!strcasecmp_ascii (key, "directory")) return LIBRARY_DIR; + if (!strcasecmp_ascii (key, "playlist")) return LIBRARY_PLAYLIST; return 0; } static void library_tab_chunk (char type, const char *path, struct str_map *map) { + // CUE files appear once as a directory and another time as a playlist, + // just skip them entirely + if (type == LIBRARY_PLAYLIST) + return; + const char *artist = str_map_find (map, "artist"); const char *title = str_map_find (map, "title"); char *name = (artist && title)