require MPD >= 0.14
This commit is contained in:
@@ -329,24 +329,15 @@ void MediaLibrary::Update()
|
|||||||
|
|
||||||
Mpd.StartSearch(1);
|
Mpd.StartSearch(1);
|
||||||
Mpd.AddSearch(Config.media_lib_primary_tag, locale_to_utf_cpy(hasTwoColumns ? Albums->Current().PrimaryTag : Artists->Current()));
|
Mpd.AddSearch(Config.media_lib_primary_tag, locale_to_utf_cpy(hasTwoColumns ? Albums->Current().PrimaryTag : Artists->Current()));
|
||||||
if (Albums->Empty()) // left for compatibility with <mpd-0.14
|
if (Albums->Current().Date != AllTracksMarker)
|
||||||
{
|
{
|
||||||
*Albums << XY(0, 0) << "No albums found.";
|
Mpd.AddSearch(MPD_TAG_ALBUM, locale_to_utf_cpy(Albums->Current().Album));
|
||||||
Albums->Window::Refresh();
|
if (Config.media_library_display_date)
|
||||||
}
|
Mpd.AddSearch(MPD_TAG_DATE, locale_to_utf_cpy(Albums->Current().Date));
|
||||||
else
|
|
||||||
{
|
|
||||||
if (Albums->Current().Date != AllTracksMarker)
|
|
||||||
{
|
|
||||||
Mpd.AddSearch(MPD_TAG_ALBUM, locale_to_utf_cpy(Albums->Current().Album));
|
|
||||||
if (Config.media_library_display_date)
|
|
||||||
Mpd.AddSearch(MPD_TAG_DATE, locale_to_utf_cpy(Albums->Current().Date));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Mpd.CommitSearch(list);
|
Mpd.CommitSearch(list);
|
||||||
|
|
||||||
if (!Albums->Empty()) // for compatibility with mpd < 0.14
|
sort(list.begin(), list.end(), Albums->Current().Date == AllTracksMarker ? SortAllTracks : SortSongsByTrack);
|
||||||
sort(list.begin(), list.end(), Albums->Current().Date == AllTracksMarker ? SortAllTracks : SortSongsByTrack);
|
|
||||||
bool bold = 0;
|
bool bold = 0;
|
||||||
|
|
||||||
for (MPD::SongList::const_iterator it = list.begin(); it != list.end(); ++it)
|
for (MPD::SongList::const_iterator it = list.begin(); it != list.end(); ++it)
|
||||||
|
|||||||
@@ -119,6 +119,12 @@ int main(int argc, char **argv)
|
|||||||
if (!ConnectToMPD())
|
if (!ConnectToMPD())
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
|
if (Mpd.Version() < 14)
|
||||||
|
{
|
||||||
|
std::cout << "MPD < 0.14 is not supported, please upgrade.\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
CreateDir(Config.ncmpcpp_directory);
|
CreateDir(Config.ncmpcpp_directory);
|
||||||
|
|
||||||
// always execute these commands, even if ncmpcpp use exit function
|
// always execute these commands, even if ncmpcpp use exit function
|
||||||
|
|||||||
Reference in New Issue
Block a user