Fix Artist sort.

Fix off-by-one error in BPM sort.
This commit is contained in:
Glenn Maynard
2003-06-19 05:30:01 +00:00
parent 08d33c546c
commit a78661f4f4
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -1255,7 +1255,7 @@ CString MusicWheel::GetSectionNameFromSongAndSort( const Song* pSong, SongSortOr
switch( so )
{
case SORT_TITLE: s = pSong->GetTranslitMainTitle(); break;
case SORT_ARTIST: s = pSong->m_sArtist; break;
case SORT_ARTIST: s = pSong->GetTranslitArtist(); break;
default: ASSERT(0);
}
s = MakeSortString(s); // resulting string will be uppercase
@@ -1275,7 +1275,7 @@ CString MusicWheel::GetSectionNameFromSongAndSort( const Song* pSong, SongSortOr
float fMinBPM, fMaxBPM;
pSong->GetDisplayBPM( fMinBPM, fMaxBPM );
int iMaxBPM = (int)fMaxBPM;
iMaxBPM += iBPMGroupSize - (iMaxBPM%iBPMGroupSize);
iMaxBPM += iBPMGroupSize - (iMaxBPM%iBPMGroupSize) - 1;
return ssprintf("%03d-%03d",iMaxBPM-(iBPMGroupSize-1), iMaxBPM);
}
case SORT_MOST_PLAYED:
+2 -2
View File
@@ -1233,8 +1233,8 @@ void SortSongPointerArrayByGrade( vector<Song*> &arraySongPointers )
int CompareSongPointersByArtist(const Song *pSong1, const Song *pSong2)
{
CString s1 = pSong1->m_sArtist;
CString s2 = pSong2->m_sArtist;
CString s1 = pSong1->GetTranslitArtist();
CString s2 = pSong2->GetTranslitArtist();
s1 = MakeSortString(s1);
s2 = MakeSortString(s2);