aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-10-24 14:46:40 +0200
committerPřemysl Eric Janouch <p@janouch.name>2020-10-24 14:58:48 +0200
commit8121046be6133d25e03b59eb5a68fa1e4f6db806 (patch)
treec820642d8cbf72533a42f43141b7b8b5f3903d87
parent0dc29a3e2d475f295f81f768669a3be0b27c5823 (diff)
downloadnncmpp-8121046be6133d25e03b59eb5a68fa1e4f6db806.tar.gz
nncmpp-8121046be6133d25e03b59eb5a68fa1e4f6db806.tar.xz
nncmpp-8121046be6133d25e03b59eb5a68fa1e4f6db806.zip
Skip playlists in lsinfo responses
Instead of merging the fields into other items.
-rw-r--r--nncmpp.c15
1 files 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)