Now reloading the playqueue at startup, better styling the show more button

This commit is contained in:
emeric
2018-09-11 14:00:55 +02:00
parent e55eb9ed83
commit f838717d8e
9 changed files with 28 additions and 6 deletions
+6
View File
@@ -534,6 +534,12 @@ static std::string msgTypeToString(MsgType type)
return "";
}
void
LmsApplication::post(std::function<void()> func)
{
Wt::WServer::instance()->post(LmsApp->sessionId(), func);
}
void
LmsApplication::notifyMsg(MsgType type, const Wt::WString& message, std::chrono::milliseconds duration)
{
+1
View File
@@ -79,6 +79,7 @@ class LmsApplication : public Wt::WApplication
void goHome();
void goHomeAndQuit();
void post(std::function<void()> func);
void notifyMsg(MsgType type, const Wt::WString& message, std::chrono::milliseconds duration = std::chrono::milliseconds(4000));
static Wt::WLink createArtistLink(Database::Artist::pointer artist);
+11
View File
@@ -86,6 +86,14 @@ PlayQueue::PlayQueue()
updateInfo();
addSome();
if (!LmsApp->getUser()->isDemo())
{
LmsApp->post([=]
{
play(LmsApp->getUser()->getCurPlayingTrackPos());
});
}
}
Database::TrackList::pointer
@@ -157,6 +165,9 @@ PlayQueue::play(std::size_t pos)
trackId = track.id();
updateCurrentTrack(true);
if (!LmsApp->getUser()->isDemo())
LmsApp->getUser().modify()->setCurPlayingTrackPos(pos);
}
playTrack.emit(trackId);