Subsonic API: added playCount

This commit is contained in:
emeric
2023-11-03 16:05:02 +01:00
parent 083652e293
commit 4089f07c16
6 changed files with 122 additions and 12 deletions
+4 -1
View File
@@ -19,8 +19,9 @@
#include "responses/Album.hpp"
#include "services/database/Cluster.hpp"
#include "services/database/Artist.hpp"
#include "services/database/Cluster.hpp"
#include "services/database/Listen.hpp"
#include "services/database/Release.hpp"
#include "services/database/User.hpp"
#include "services/feedback/IFeedbackService.hpp"
@@ -124,6 +125,8 @@ namespace API::Subsonic
}
}
albumNode.setAttribute("playCount", Listen::getCount(context.dbSession, user->getId(), user->getScrobblingBackend(), release->getId()));
// Report the first GENRE for this track
const ClusterType::pointer genreClusterType{ ClusterType::find(context.dbSession, "GENRE") };
if (genreClusterType)