Subsonic API: cached cluster stats for track and releases, in order to make the getGenre entrypoint efficient on large databases

This commit is contained in:
emeric
2023-11-08 20:26:24 +01:00
parent c2e1c5d9df
commit 121d27b5cd
20 changed files with 301 additions and 101 deletions
+2 -2
View File
@@ -168,7 +168,7 @@ namespace API::Subsonic
params.setClusterType(clusterType->getId());
for (const auto& cluster : Cluster::find(context.dbSession, params).results)
albumNode.addArrayValue(field, std::get<std::string>(cluster));
albumNode.addArrayValue(field, cluster->getName());
}
} };
@@ -183,7 +183,7 @@ namespace API::Subsonic
params.setClusterType(genreClusterType->getId());
for (const auto& cluster : Cluster::find(context.dbSession, params).results)
albumNode.addArrayChild("genres", createItemGenreNode(std::get<std::string>(cluster)));
albumNode.addArrayChild("genres", createItemGenreNode(cluster->getName()));
}
albumNode.createEmptyArrayChild("artists");