MediaLibrary::LocateSong: compare hashes, not strings

This commit is contained in:
Andrzej Rybczak
2010-05-14 01:22:32 +02:00
parent 02d3ec0e2a
commit 8de70f3918

View File

@@ -643,12 +643,11 @@ void MediaLibrary::LocateSong(const MPD::Song &s)
if (Songs->Empty()) if (Songs->Empty())
Update(); Update();
std::string song = s.GetTitle(); if (s.GetHash() != Songs->Current().GetHash())
if (song != Songs->Current().GetTitle())
{ {
for (size_t i = 0; i < Songs->Size(); ++i) for (size_t i = 0; i < Songs->Size(); ++i)
{ {
if (song == (*Songs)[i].GetTitle()) if (s.GetHash() == (*Songs)[i].GetHash())
{ {
Songs->Highlight(i); Songs->Highlight(i);
break; break;