Added album play time. Fixes #186

This commit is contained in:
emeric
2022-02-01 23:17:51 +01:00
parent 1e0bf58092
commit 71d6d4825f
6 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -455,7 +455,7 @@ PlayQueue::addEntry(const Database::TrackListEntry::pointer& tracklistEntry)
cover->setAttributeValue("onload", LmsApp->javaScriptClass() + ".onLoadCover(this)");
}
entry->bindString("duration", trackDurationToString(track->getDuration()), Wt::TextFormat::Plain);
entry->bindString("duration", durationToString(track->getDuration()), Wt::TextFormat::Plain);
Wt::WText* playBtn {entry->bindNew<Wt::WText>("play-btn", Wt::WString::tr("Lms.PlayQueue.template.play-btn"), Wt::TextFormat::XHTML)};
playBtn->clicked().connect([=]
+1 -1
View File
@@ -23,7 +23,7 @@
#include <sstream>
std::string
trackDurationToString(std::chrono::milliseconds msDuration)
durationToString(std::chrono::milliseconds msDuration)
{
const std::chrono::seconds duration {std::chrono::duration_cast<std::chrono::seconds>(msDuration)};
+1 -1
View File
@@ -23,5 +23,5 @@
#include <string>
std::string
trackDurationToString(std::chrono::milliseconds msDuration);
durationToString(std::chrono::milliseconds msDuration);
+3 -1
View File
@@ -129,6 +129,8 @@ Release::refreshView()
}
}
bindString("duration", durationToString(release->getDuration()), Wt::TextFormat::Plain);
refreshReleaseArtists(release);
{
@@ -250,7 +252,7 @@ Release::refreshView()
displayTrackPopupMenu(*moreBtn, trackId, tracksAction);
});
entry->bindString("duration", trackDurationToString(track->getDuration()), Wt::TextFormat::Plain);
entry->bindString("duration", durationToString(track->getDuration()), Wt::TextFormat::Plain);
LmsApp->getMediaPlayer().trackLoaded.connect(entry, [=] (TrackId loadedTrackId)
{
+1 -1
View File
@@ -87,7 +87,7 @@ namespace UserInterface::TrackListHelpers
cover->setAttributeValue("onload", LmsApp->javaScriptClass() + ".onLoadCover(this)");
}
entry->bindString("duration", trackDurationToString(track->getDuration()), Wt::TextFormat::Plain);
entry->bindString("duration", durationToString(track->getDuration()), Wt::TextFormat::Plain);
Wt::WText* playBtn = entry->bindNew<Wt::WText>("play-btn", Wt::WString::tr("Lms.Explore.template.play-btn"), Wt::TextFormat::XHTML);
playBtn->clicked().connect([trackId, &tracksAction]