compare hashes instead of filenames

This commit is contained in:
unknown
2008-08-09 03:31:25 +02:00
parent f7abc08c16
commit 828ec8e2f6
7 changed files with 45 additions and 51 deletions

View File

@@ -36,7 +36,8 @@ void DefineEmptyTags()
UNKNOWN_ALBUM = "[" + et_col + "]<no album>[/" + et_col + "]";
}
Song::Song(mpd_Song *s) : itsMinutesLength(s->time/60),
Song::Song(mpd_Song *s) : itsHash(0),
itsMinutesLength(s->time/60),
itsSecondsLength((s->time-itsMinutesLength*60)),
itsPosition(s->pos),
itsID(s->id),
@@ -67,6 +68,14 @@ Song::Song(mpd_Song *s) : itsMinutesLength(s->time/60),
itsDirectory = "/";
itsShortName = itsFile;
}
// generate pseudo-hash
i = 0;
for (string::const_iterator it = itsFile.begin(); it != itsFile.end(); it++, i++)
{
itsHash += *it;
if (i%2)
itsHash *= *it;
}
}
string Song::GetLength() const