Improve error message if 'playlist_directory' does not exist.
BUG: 358
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
2. Improve internal HTTP security - only server files to MPD host, and only
|
||||
serve files in playqueue.
|
||||
3. Also remove CDDA files when Cantata exits.
|
||||
4. Improve error message if 'playlist_directory' does not exist.
|
||||
|
||||
1.2.1
|
||||
-----
|
||||
|
||||
@@ -128,11 +128,16 @@ QString MPDConnection::Response::getError(const QByteArray &command)
|
||||
|
||||
if (!ok && data.size()>0) {
|
||||
int cmdEnd=data.indexOf("} ");
|
||||
if (-1!=cmdEnd) {
|
||||
if (-1==cmdEnd) {
|
||||
return i18n("Uknown")+QLatin1String(" (")+command+QLatin1Char(')');
|
||||
} else {
|
||||
cmdEnd+=2;
|
||||
data=data.mid(cmdEnd, data.length()-(data.endsWith('\n') ? cmdEnd+1 : cmdEnd));
|
||||
QString rv=data.mid(cmdEnd, data.length()-(data.endsWith('\n') ? cmdEnd+1 : cmdEnd));
|
||||
if (data.contains("{listplaylists}")) {
|
||||
// NOT: NOT transalted, as refers to config item
|
||||
return QLatin1String("playlist_directory - ")+rv;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user