Make playlist ignore articles when sorting (#202)
This is more correct, and the other way is driving me crazy.
This commit is contained in:
committed by
Jonas Kvinge
parent
64750025f6
commit
5cde33711e
@@ -1286,14 +1286,12 @@ QString CollectionModel::SortTextForArtist(QString artist) {
|
||||
|
||||
artist = SortText(artist);
|
||||
|
||||
if (artist.startsWith("the ")) {
|
||||
artist = artist.right(artist.length() - 4) + ", the";
|
||||
}
|
||||
else if (artist.startsWith("a ")) {
|
||||
artist = artist.right(artist.length() - 2) + ", a";
|
||||
}
|
||||
else if (artist.startsWith("an ")) {
|
||||
artist = artist.right(artist.length() - 3) + ", an";
|
||||
for (const auto &i : Song::kArticles) {
|
||||
if (artist.startsWith(i)) {
|
||||
int ilen = i.length();
|
||||
artist = artist.right(artist.length() - ilen) + ", " + i.left(ilen - 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return artist;
|
||||
|
||||
Reference in New Issue
Block a user