mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-18 12:32:09 +01:00
Consistently added GroupBy_Bitrate enum item
This commit is contained in:
parent
a8ae737bce
commit
d53bcde897
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,6 +8,7 @@
|
||||
*.dll
|
||||
*.exe
|
||||
*.pyd
|
||||
build/
|
||||
3rdparty/libprojectm/config.inp
|
||||
3rdparty/libprojectm/libprojectM.pc
|
||||
CMakeLists.txt.user
|
||||
|
@ -145,8 +145,12 @@ QStandardItem* GlobalSearchModel::BuildContainers(
|
||||
sort_text = display_text;
|
||||
break;
|
||||
|
||||
case LibraryModel::GroupBy_Bitrate:
|
||||
return parent;
|
||||
|
||||
case LibraryModel::GroupBy_None:
|
||||
return parent;
|
||||
|
||||
}
|
||||
|
||||
// Find a container for this level
|
||||
|
@ -190,6 +190,9 @@ void LibraryModel::SongsDiscovered(const SongList& songs) {
|
||||
case GroupBy_YearAlbum:
|
||||
key = PrettyYearAlbum(qMax(0, song.year()), song.album()); break;
|
||||
case GroupBy_FileType: key = song.filetype(); break;
|
||||
case GroupBy_Bitrate:
|
||||
qLog(Error) << "GroupBy_Bitrate";
|
||||
break;
|
||||
case GroupBy_None:
|
||||
qLog(Error) << "GroupBy_None";
|
||||
break;
|
||||
@ -280,6 +283,9 @@ QString LibraryModel::DividerKey(GroupBy type, LibraryItem* item) const {
|
||||
case GroupBy_YearAlbum:
|
||||
return SortTextForYear(item->metadata.year());
|
||||
|
||||
case GroupBy_Bitrate:
|
||||
return QString();
|
||||
|
||||
case GroupBy_None:
|
||||
return QString();
|
||||
}
|
||||
@ -313,6 +319,10 @@ QString LibraryModel::DividerDisplayText(GroupBy type, const QString& key) const
|
||||
return tr("Unknown");
|
||||
return QString::number(key.toInt()); // To remove leading 0s
|
||||
|
||||
case GroupBy_Bitrate:
|
||||
// fallthrough
|
||||
;
|
||||
|
||||
case GroupBy_None:
|
||||
// fallthrough
|
||||
;
|
||||
@ -739,6 +749,9 @@ void LibraryModel::InitQuery(GroupBy type, LibraryQuery* q) {
|
||||
case GroupBy_AlbumArtist:
|
||||
q->SetColumnSpec("DISTINCT effective_albumartist");
|
||||
break;
|
||||
case GroupBy_Bitrate:
|
||||
q->SetColumnSpec("%songs_table.ROWID, " + Song::kColumnSpec);
|
||||
break;
|
||||
case GroupBy_None:
|
||||
q->SetColumnSpec("%songs_table.ROWID, " + Song::kColumnSpec);
|
||||
break;
|
||||
@ -796,6 +809,9 @@ void LibraryModel::FilterQuery(GroupBy type, LibraryItem* item, LibraryQuery* q)
|
||||
case GroupBy_FileType:
|
||||
q->AddWhere("filetype", item->metadata.filetype());
|
||||
break;
|
||||
case GroupBy_Bitrate:
|
||||
qLog(Error) << "Unknown GroupBy type" << type << "used in filter";
|
||||
break;
|
||||
case GroupBy_None:
|
||||
qLog(Error) << "Unknown GroupBy type" << type << "used in filter";
|
||||
break;
|
||||
@ -863,6 +879,13 @@ LibraryItem* LibraryModel::ItemFromQuery(GroupBy type,
|
||||
item->key = item->metadata.TextForFiletype();
|
||||
break;
|
||||
|
||||
case GroupBy_Bitrate:
|
||||
item->metadata.InitFromQuery(row, true);
|
||||
item->key = item->metadata.title();
|
||||
item->display_text = item->metadata.TitleWithCompilationArtist();
|
||||
item->sort_text = SortTextForSong(item->metadata);
|
||||
break;
|
||||
|
||||
case GroupBy_None:
|
||||
item->metadata.InitFromQuery(row, true);
|
||||
item->key = item->metadata.title();
|
||||
@ -918,6 +941,13 @@ LibraryItem* LibraryModel::ItemFromSong(GroupBy type,
|
||||
item->key = s.TextForFiletype();
|
||||
break;
|
||||
|
||||
case GroupBy_Bitrate:
|
||||
item->metadata = s;
|
||||
item->key = s.title();
|
||||
item->display_text = s.TitleWithCompilationArtist();
|
||||
item->sort_text = SortTextForSong(s);
|
||||
break;
|
||||
|
||||
case GroupBy_None:
|
||||
item->metadata = s;
|
||||
item->key = s.title();
|
||||
|
@ -82,6 +82,7 @@ class LibraryModel : public SimpleTreeModel<LibraryItem> {
|
||||
GroupBy_FileType = 8,
|
||||
GroupBy_Performer = 9,
|
||||
GroupBy_Grouping = 10,
|
||||
GroupBy_Bitrate = 11,
|
||||
};
|
||||
|
||||
struct Grouping {
|
||||
|
Loading…
Reference in New Issue
Block a user