search3: minor optim

This commit is contained in:
emeric
2025-06-12 22:44:14 +02:00
parent 0b0b8a34d1
commit 4837e1959f
3 changed files with 25 additions and 8 deletions
+3 -3
View File
@@ -131,9 +131,9 @@ namespace lms::api::subsonic
const ClusterType::pointer genreClusterType{ ClusterType::find(context.dbSession, "GENRE") };
if (genreClusterType)
{
auto clusters{ release->getClusterGroups({ genreClusterType->getId() }, 1) };
if (!clusters.empty() && !clusters.front().empty())
albumNode.setAttribute("genre", clusters.front().front()->getName());
const auto clusters{ release->getClusters(genreClusterType->getId(), 1) };
if (!clusters.empty())
albumNode.setAttribute("genre", clusters.front()->getName());
}
if (const Wt::WDateTime dateTime{ core::Service<feedback::IFeedbackService>::get()->getStarredDateTime(context.user->getId(), release->getId()) }; dateTime.isValid())