Displaying all release artists instead of just 'Various Artists' in the release view, ref #154

This commit is contained in:
emeric
2021-05-10 14:57:31 +02:00
parent 6e86fe2f62
commit a110b6737d
2 changed files with 16 additions and 12 deletions
+10 -10
View File
@@ -114,15 +114,16 @@ Release::refreshView()
if (artists.empty())
artists = release->getArtists();
if (artists.size() > 1)
if (!artists.empty())
{
setCondition("if-has-artist", true);
bindNew<Wt::WText>("artist", Wt::WString::tr("Lms.Explore.various-artists"));
}
else if (artists.size() == 1)
{
setCondition("if-has-artist", true);
bindWidget("artist", LmsApplication::createArtistAnchor(artists.front()));
setCondition("if-has-release-artists", true);
Wt::WContainerWidget* artistsContainer {bindNew<Wt::WContainerWidget>("artists")};
for (const auto& artist : artists)
{
Wt::WTemplate* artistTemplate {artistsContainer->addNew<Wt::WTemplate>(Wt::WString::tr("Lms.Explore.Release.template.entry-release-artist"))};
artistTemplate->bindWidget("artist", LmsApplication::createArtistAnchor(artist));
}
}
}
@@ -183,8 +184,7 @@ Release::refreshView()
return it->second;
}
Wt::WTemplate* disc {rootContainer->addNew<Wt::WTemplate>(Wt::WString::tr("Lms.Explore.Release.template.disc-entry"))};
disc->addFunction("tr", &Wt::WTemplate::Functions::tr);
Wt::WTemplate* disc {rootContainer->addNew<Wt::WTemplate>(Wt::WString::tr("Lms.Explore.Release.template.entry-disc"))};
if (discSubtitle.empty())
disc->bindNew<Wt::WText>("disc-title", Wt::WString::tr("Lms.Explore.Release.disc").arg(discNumber));