Updated play queue
This commit is contained in:
+17
-6
@@ -40,23 +40,34 @@
|
|||||||
<div class="p-1">
|
<div class="p-1">
|
||||||
${cover}
|
${cover}
|
||||||
</div>
|
</div>
|
||||||
<div class="p-2 flex-fill text-truncate">
|
<div class="row align-items-center flex-fill overflow-hidden">
|
||||||
|
<div class="col-12 col-md-6 col-lg-4">
|
||||||
|
<div class="p-2 overflow-hidden">
|
||||||
<div class="d-block text-truncate">${name}</div>
|
<div class="d-block text-truncate">${name}</div>
|
||||||
${<if-has-release>}${release class="text-decoration-none link-success text-truncate"}${</if-has-release>}
|
${<if-has-artists>}${artists class="d-block d-md-none text-truncate"}${</if-has-artists>}
|
||||||
</div>
|
</div>
|
||||||
<div class="p-2 d-none d-sm-block text-muted">
|
</div>
|
||||||
|
<div class="col-md-6 col-lg-4">
|
||||||
|
${<if-has-artists>}${artists-md class="d-none d-md-block text-truncate"}${</if-has-artists>}
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4 text-truncate">
|
||||||
|
${<if-has-release>}${release class="d-none d-lg-inline text-truncate text-decoration-none link-success"}${</if-has-release>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="p-2 d-none d-sm-block text-muted text-center Lms-tracks-entry-duration">
|
||||||
${duration}
|
${duration}
|
||||||
</div>
|
</div>
|
||||||
<div class="p-2 d-flex">
|
<div class="p-2 d-flex">
|
||||||
${play-btn class="btn btn-sm btn-outline-secondary border-0"}
|
${play-btn class="d-none d-sm-block btn btn-sm btn-outline-secondary border-0"}
|
||||||
<div class="dropdown d-none d-sm-block">
|
${del-btn class="btn btn-sm btn-outline-secondary border-0"}
|
||||||
|
<div class="dropdown d-inline-block">
|
||||||
${more-btn data-bs-toggle="dropdown" aria-expanded="false" class="btn btn-sm btn-outline-secondary border-0"}
|
${more-btn data-bs-toggle="dropdown" aria-expanded="false" class="btn btn-sm btn-outline-secondary border-0"}
|
||||||
<ul class="dropdown-menu" aria-labelledby="${id:more-btn}">
|
<ul class="dropdown-menu" aria-labelledby="${id:more-btn}">
|
||||||
|
<li>${play class="dropdown-item"}</li>
|
||||||
<li>${star class="dropdown-item"}</li>
|
<li>${star class="dropdown-item"}</li>
|
||||||
<li>${download class="dropdown-item"}</li>
|
<li>${download class="dropdown-item"}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
${del-btn class="btn btn-sm btn-outline-secondary border-0"}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</message>
|
</message>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <Wt/WStackedWidget.h>
|
#include <Wt/WStackedWidget.h>
|
||||||
#include <Wt/WTemplateFormView.h>
|
#include <Wt/WTemplateFormView.h>
|
||||||
|
|
||||||
|
#include "services/database/Artist.hpp"
|
||||||
#include "services/database/Release.hpp"
|
#include "services/database/Release.hpp"
|
||||||
#include "services/database/Session.hpp"
|
#include "services/database/Session.hpp"
|
||||||
#include "services/database/Track.hpp"
|
#include "services/database/Track.hpp"
|
||||||
@@ -489,6 +490,15 @@ PlayQueue::addEntry(const Database::TrackListEntry::pointer& tracklistEntry)
|
|||||||
|
|
||||||
entry->bindString("name", Wt::WString::fromUTF8(track->getName()), Wt::TextFormat::Plain);
|
entry->bindString("name", Wt::WString::fromUTF8(track->getName()), Wt::TextFormat::Plain);
|
||||||
|
|
||||||
|
const auto artists {track->getArtistIds({Database::TrackArtistLinkType::Artist})};
|
||||||
|
LMS_LOG(UI, DEBUG) << "Found " << artists.size() << " artists!";
|
||||||
|
if (!artists.empty())
|
||||||
|
{
|
||||||
|
entry->setCondition("if-has-artists", true);
|
||||||
|
entry->bindWidget("artists", Utils::createArtistContainer(artists));
|
||||||
|
entry->bindWidget("artists-md", Utils::createArtistContainer(artists));
|
||||||
|
}
|
||||||
|
|
||||||
const auto release {track->getRelease()};
|
const auto release {track->getRelease()};
|
||||||
if (release)
|
if (release)
|
||||||
{
|
{
|
||||||
@@ -542,6 +552,13 @@ PlayQueue::addEntry(const Database::TrackListEntry::pointer& tracklistEntry)
|
|||||||
});
|
});
|
||||||
|
|
||||||
entry->bindNew<Wt::WPushButton>("more-btn", Wt::WString::tr("Lms.template.more-btn"), Wt::TextFormat::XHTML);
|
entry->bindNew<Wt::WPushButton>("more-btn", Wt::WString::tr("Lms.template.more-btn"), Wt::TextFormat::XHTML);
|
||||||
|
entry->bindNew<Wt::WPushButton>("play", Wt::WString::tr("Lms.Explore.play"))
|
||||||
|
->clicked().connect([=]
|
||||||
|
{
|
||||||
|
const std::optional<std::size_t> pos {_entriesContainer->getIndexOf(*entry)};
|
||||||
|
if (pos)
|
||||||
|
loadTrack(*pos, true);
|
||||||
|
});
|
||||||
|
|
||||||
auto isStarred {[=] { return Service<Scrobbling::IScrobblingService>::get()->isStarred(LmsApp->getUserId(), trackId); }};
|
auto isStarred {[=] { return Service<Scrobbling::IScrobblingService>::get()->isStarred(LmsApp->getUserId(), trackId); }};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user