Added most played artists feature

This commit is contained in:
emeric
2018-06-05 13:18:55 +02:00
parent 96dd5d48ce
commit da2e2148cf
8 changed files with 47 additions and 5 deletions
+7 -1
View File
@@ -28,6 +28,7 @@
#include "utils/Logger.hpp"
#include "database/Playlist.hpp"
#include "database/TrackStats.hpp"
#include "LmsApplication.hpp"
@@ -116,7 +117,12 @@ PlayQueue::play(std::size_t pos)
addRadioTrack();
_trackPos = pos;
trackId = playlist->getEntry(*_trackPos)->getTrack().id();
auto track = playlist->getEntry(*_trackPos)->getTrack();
trackId = track.id();
Database::TrackStats::get(LmsApp->getDboSession(), track, LmsApp->getCurrentUser()).modify()->incPlayCount();
updateCurrentTrack(true);
}