Fix Artist sort.
Fix off-by-one error in BPM sort.
This commit is contained in:
@@ -1255,7 +1255,7 @@ CString MusicWheel::GetSectionNameFromSongAndSort( const Song* pSong, SongSortOr
|
|||||||
switch( so )
|
switch( so )
|
||||||
{
|
{
|
||||||
case SORT_TITLE: s = pSong->GetTranslitMainTitle(); break;
|
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);
|
default: ASSERT(0);
|
||||||
}
|
}
|
||||||
s = MakeSortString(s); // resulting string will be uppercase
|
s = MakeSortString(s); // resulting string will be uppercase
|
||||||
@@ -1275,7 +1275,7 @@ CString MusicWheel::GetSectionNameFromSongAndSort( const Song* pSong, SongSortOr
|
|||||||
float fMinBPM, fMaxBPM;
|
float fMinBPM, fMaxBPM;
|
||||||
pSong->GetDisplayBPM( fMinBPM, fMaxBPM );
|
pSong->GetDisplayBPM( fMinBPM, fMaxBPM );
|
||||||
int iMaxBPM = (int)fMaxBPM;
|
int iMaxBPM = (int)fMaxBPM;
|
||||||
iMaxBPM += iBPMGroupSize - (iMaxBPM%iBPMGroupSize);
|
iMaxBPM += iBPMGroupSize - (iMaxBPM%iBPMGroupSize) - 1;
|
||||||
return ssprintf("%03d-%03d",iMaxBPM-(iBPMGroupSize-1), iMaxBPM);
|
return ssprintf("%03d-%03d",iMaxBPM-(iBPMGroupSize-1), iMaxBPM);
|
||||||
}
|
}
|
||||||
case SORT_MOST_PLAYED:
|
case SORT_MOST_PLAYED:
|
||||||
|
|||||||
@@ -1233,8 +1233,8 @@ void SortSongPointerArrayByGrade( vector<Song*> &arraySongPointers )
|
|||||||
|
|
||||||
int CompareSongPointersByArtist(const Song *pSong1, const Song *pSong2)
|
int CompareSongPointersByArtist(const Song *pSong1, const Song *pSong2)
|
||||||
{
|
{
|
||||||
CString s1 = pSong1->m_sArtist;
|
CString s1 = pSong1->GetTranslitArtist();
|
||||||
CString s2 = pSong2->m_sArtist;
|
CString s2 = pSong2->GetTranslitArtist();
|
||||||
|
|
||||||
s1 = MakeSortString(s1);
|
s1 = MakeSortString(s1);
|
||||||
s2 = MakeSortString(s2);
|
s2 = MakeSortString(s2);
|
||||||
|
|||||||
Reference in New Issue
Block a user