From 2181773dea55a3bd1a5ddbab7052452f2fc2d7b6 Mon Sep 17 00:00:00 2001 From: Craig Drummond Date: Fri, 16 Oct 2015 22:41:55 +0100 Subject: [PATCH] If "list genre" returns empty, then also check "list artist". If both are empty, then we can assume backend is upnp --- mpd-interface/mpdconnection.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mpd-interface/mpdconnection.cpp b/mpd-interface/mpdconnection.cpp index c959b539b..102d806da 100644 --- a/mpd-interface/mpdconnection.cpp +++ b/mpd-interface/mpdconnection.cpp @@ -1910,9 +1910,13 @@ bool MPDConnection::recursivelyListDir(const QString &dir) // UPnP servers returing directories of classifications - Genre/Album/Tracks, Artist/Album/Tracks, // etc... if (topLevel) { - Response response=sendCommand("list genre"); + Response response=sendCommand("list genre", false, false); if (!response.ok || response.data.split('\n').length()<3) { // 2 lines - OK and blank - return false; + // ..just to be 100% sure, check no artists either... + response=sendCommand("list artist", false, false); + if (!response.ok || response.data.split('\n').length()<3) { // 2 lines - OK and blank + return false; + } } }