Handle listallinfo failures more gracefully
This commit is contained in:
@@ -302,7 +302,18 @@ void MediaLibrary::update()
|
||||
m_albums_update_request = false;
|
||||
sunfilter_albums.set(ReapplyFilter::Yes, true);
|
||||
std::map<std::tuple<std::string, std::string, std::string>, time_t> albums;
|
||||
for (MPD::SongIterator s = getDatabaseIterator(Mpd), end; s != end; ++s)
|
||||
MPD::SongIterator s, end;
|
||||
try
|
||||
{
|
||||
s = Mpd.GetDirectoryRecursive("/");
|
||||
}
|
||||
catch (MPD::Error &e)
|
||||
{
|
||||
// If there was a problem, fall back to a different column mode.
|
||||
toggleColumnsMode();
|
||||
throw;
|
||||
}
|
||||
for (; s != end; ++s)
|
||||
{
|
||||
std::string tag;
|
||||
unsigned idx = 0;
|
||||
@@ -349,7 +360,18 @@ void MediaLibrary::update()
|
||||
std::map<std::string, time_t> tags;
|
||||
if (Config.media_library_sort_by_mtime)
|
||||
{
|
||||
for (MPD::SongIterator s = getDatabaseIterator(Mpd), end; s != end; ++s)
|
||||
MPD::SongIterator s, end;
|
||||
try
|
||||
{
|
||||
s = Mpd.GetDirectoryRecursive("/");
|
||||
}
|
||||
catch (MPD::Error &e)
|
||||
{
|
||||
// If there was a problem, fall back to a different sorting mode.
|
||||
toggleSortMode();
|
||||
throw;
|
||||
}
|
||||
for (; s != end; ++s)
|
||||
{
|
||||
std::string tag;
|
||||
unsigned idx = 0;
|
||||
|
||||
@@ -500,7 +500,7 @@ void SearchEngine::Search()
|
||||
input_song_iterator s, end;
|
||||
if (Config.search_in_db)
|
||||
{
|
||||
s = input_song_iterator(getDatabaseIterator(Mpd));
|
||||
s = input_song_iterator(Mpd.GetDirectoryRecursive("/"));
|
||||
end = input_song_iterator(MPD::SongIterator());
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user