Skip to content

Commit

Permalink
fixup! PlaylistStatsDAO: Consolidate into a single DAO instance
Browse files Browse the repository at this point in the history
  • Loading branch information
cr7pt0gr4ph7 committed Apr 27, 2024
1 parent 9244aee commit 45b451f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/library/trackset/playlistfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ QList<BasePlaylistFeature::IdAndLabel> PlaylistFeature::createPlaylistLabels() {
m_pLibrary->trackCollectionManager()->internalCollection()->getPlaylistStatsDAO();

QList<BasePlaylistFeature::IdAndLabel> playlistLabels;
for (auto playlistInfo : playlistStatsDao.getPlaylistSummaries(PlaylistDAO::PLHT_NOT_HIDDEN)) {
for (const auto& playlistInfo : playlistStatsDao.getPlaylistSummaries(
PlaylistDAO::PLHT_NOT_HIDDEN)) {
BasePlaylistFeature::IdAndLabel idAndLabel;
idAndLabel.id = playlistInfo.playlistId;
idAndLabel.label = createPlaylistLabel(
Expand Down
3 changes: 2 additions & 1 deletion src/library/trackset/setlogfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ QModelIndex SetlogFeature::constructChildModel(int selectedId) {
// Generous estimate (number of years the db is used ;))
itemList.reserve(kNumToplevelHistoryEntries + 15);
int numEntries = 0;
for (auto playlistInfo : playlistStatsDao.getPlaylistSummaries(PlaylistDAO::PLHT_SET_LOG)) {
for (const auto& playlistInfo :
playlistStatsDao.getPlaylistSummaries(PlaylistDAO::PLHT_SET_LOG)) {
int id = playlistInfo.playlistId;
QString label = createPlaylistLabel(
playlistInfo.name, playlistInfo.count, playlistInfo.duration);
Expand Down

0 comments on commit 45b451f

Please sign in to comment.