summaryrefslogtreecommitdiff
path: root/src/media_library.cpp
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2010-06-17 16:41:49 +0200
committerAndrzej Rybczak <electricityispower@gmail.com>2010-06-17 16:41:49 +0200
commit9c02bbf596ecabe00fb8280f953265560012ff36 (patch)
tree5df2d3fdb53f7204548e580a0c56267a13d9edb2 /src/media_library.cpp
parent10cea746e9da0027b6b9fef0a111fcdccb03cc03 (diff)
media library/tag editor: block idle while doing hierarchical searches
idle should be blocked in such cases since it would be enabled and disabled a few times by each mpd command, which makes no sense and slows down the whole process.
Diffstat (limited to 'src/media_library.cpp')
-rw-r--r--src/media_library.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/media_library.cpp b/src/media_library.cpp
index 97d95b0b..d4cc92d3 100644
--- a/src/media_library.cpp
+++ b/src/media_library.cpp
@@ -201,6 +201,10 @@ void MediaLibrary::Update()
if (!hasTwoColumns && !Artists->Empty() && Albums->Empty() && Songs->Empty())
{
+ // idle has to be blocked for now since it would be enabled and
+ // disabled a few times by each mpd command, which makes no sense
+ // and slows down the whole process.
+ Mpd.BlockIdle(1);
Albums->Reset();
MPD::TagList list;
locale_to_utf(Artists->Current());
@@ -239,6 +243,7 @@ void MediaLibrary::Update()
Albums->AddOption(SearchConstraints("", AllTracksMarker));
}
Albums->Refresh();
+ Mpd.BlockIdle(0);
}
else if (hasTwoColumns && Albums->Empty())
{
@@ -246,6 +251,7 @@ void MediaLibrary::Update()
MPD::TagList artists;
*Albums << XY(0, 0) << "Fetching albums...";
Albums->Window::Refresh();
+ Mpd.BlockIdle(1);
Mpd.GetList(artists, Config.media_lib_primary_tag);
for (MPD::TagList::iterator i = artists.begin(); i != artists.end(); ++i)
{
@@ -289,6 +295,7 @@ void MediaLibrary::Update()
}
}
}
+ Mpd.BlockIdle(0);
if (!Albums->Empty())
Albums->Sort<SearchConstraintsSorting>();
Albums->Refresh();