Bigger releases entries, added comment at the end of the name

This commit is contained in:
emeric
2025-02-07 18:04:56 +01:00
parent 4fe6edb87f
commit 4cb6a70d2b
5 changed files with 27 additions and 7 deletions
+7 -1
View File
@@ -299,10 +299,16 @@ namespace lms::ui::utils
std::unique_ptr<Wt::WAnchor> createReleaseAnchor(db::Release::pointer release, bool setText)
{
auto res = std::make_unique<Wt::WAnchor>(createReleaseLink(release));
if (setText)
{
std::string releaseName{ release->getName() };
if (std::string_view releaseComment{ release->getComment() }; !releaseComment.empty())
{
releaseName += " [";
releaseName += releaseComment;
releaseName += ']';
}
res->setTextFormat(Wt::TextFormat::Plain);
res->setText(Wt::WString::fromUTF8(releaseName));
res->setToolTip(Wt::WString::fromUTF8(releaseName), Wt::TextFormat::Plain);
+6 -1
View File
@@ -216,7 +216,7 @@ namespace lms::ui
if (!releaseId)
throw ReleaseNotFoundException{};
auto similarReleasesIds{ core::Service<recommendation::IRecommendationService>::get()->getSimilarReleases(*releaseId, 6) };
auto similarReleasesIds{ core::Service<recommendation::IRecommendationService>::get()->getSimilarReleases(*releaseId, 5) };
auto transaction{ LmsApp->getDbSession().createReadTransaction() };
@@ -232,6 +232,11 @@ namespace lms::ui
refreshSimilarReleases(similarReleasesIds);
bindString("name", Wt::WString::fromUTF8(std::string{ release->getName() }), Wt::TextFormat::Plain);
if (std::string_view comment{ release->getComment() }; !comment.empty())
{
setCondition("if-has-release-comment", true);
bindString("comment", Wt::WString::fromUTF8(std::string{ comment }), Wt::TextFormat::Plain);
}
Wt::WString year{ releaseHelpers::buildReleaseYearString(release->getYear(), release->getOriginalYear()) };
if (!year.empty())