Order genres, so that comparison works
This commit is contained in:
committed by
craig.p.drummond
parent
84f6548263
commit
63c45d3640
@@ -318,6 +318,7 @@ Song MPDParseUtils::parseSong(const QList<QByteArray> &lines, Location location)
|
||||
if (Loc_Library==location) {
|
||||
song.guessTags();
|
||||
song.fillEmptyFields();
|
||||
song.orderGenres();
|
||||
} else if (Loc_Streams==location) {
|
||||
song.setName(getAndRemoveStreamName(song.file));
|
||||
} else {
|
||||
|
||||
@@ -418,6 +418,15 @@ QStringList Song::genres() const
|
||||
return genre.split(constGenreSep, QString::SkipEmptyParts);
|
||||
}
|
||||
|
||||
void Song::orderGenres()
|
||||
{
|
||||
QStringList g=genres();
|
||||
if (g.count()>1) {
|
||||
qSort(g);
|
||||
genre=g.join(QString()+constGenreSep);
|
||||
}
|
||||
}
|
||||
|
||||
QString Song::entryName() const
|
||||
{
|
||||
if (title.isEmpty()) {
|
||||
|
||||
@@ -117,6 +117,7 @@ struct Song
|
||||
virtual void clear();
|
||||
void addGenre(const QString &g);
|
||||
QStringList genres() const;
|
||||
void orderGenres();
|
||||
QString entryName() const;
|
||||
QString artistOrComposer() const;
|
||||
QString albumName() const;
|
||||
|
||||
Reference in New Issue
Block a user