From 0185ee7fa468f7d8df04a67a879e4ead5f6da28e Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sun, 26 Mar 2017 11:17:03 +0200 Subject: [PATCH] Media library: prevent looping when mopidy is sent 'listallinfo' command --- src/helpers.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/helpers.cpp b/src/helpers.cpp index 7acc18b..5d5bcd9 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -61,6 +61,17 @@ MPD::SongIterator getDatabaseIterator(MPD::Connection &mpd) else throw; } + catch (MPD::ServerError &e) + { + // mopidy blacklists 'listallinfo' command by default and throws server + // error when it receives it. Work around that to prevent ncmpcpp from + // continuously retrying to send the command and looping. + if (strstr(e.what(), "listallinfo") != nullptr + && strstr(e.what(), "disabled") != nullptr) + Statusbar::print("Unable to fetch the data, server refused to process 'listallinfo' command"); + else + throw; + } return result; } -- 2.11.4.GIT