diff --git a/approot/artists.xml b/approot/artists.xml index 5d3f6b54..bff7fa7f 100644 --- a/approot/artists.xml +++ b/approot/artists.xml @@ -15,7 +15,7 @@ ${artists}
- ${show-more class="btn-primary"} + ${show-more class="btn-primary Lms-show-more"}
diff --git a/approot/playhistory.xml b/approot/playhistory.xml index a3494269..11bd1bca 100644 --- a/approot/playhistory.xml +++ b/approot/playhistory.xml @@ -9,7 +9,7 @@ ${entries}
- ${show-more class="btn-primary"} + ${show-more class="btn-primary Lms-show-more"}
diff --git a/approot/playqueue.xml b/approot/playqueue.xml index 30e76879..56eda2a6 100644 --- a/approot/playqueue.xml +++ b/approot/playqueue.xml @@ -21,7 +21,7 @@ ${entries}
- ${show-more class="btn-primary"} + ${show-more class="btn-primary Lms-show-more"}
diff --git a/approot/releases.xml b/approot/releases.xml index c9952ef8..b28540ed 100644 --- a/approot/releases.xml +++ b/approot/releases.xml @@ -15,7 +15,7 @@ ${releases}
- ${show-more class="btn-primary"} + ${show-more class="btn-primary Lms-show-more"}
diff --git a/approot/tracks.xml b/approot/tracks.xml index 0c7d9f14..7196eac1 100644 --- a/approot/tracks.xml +++ b/approot/tracks.xml @@ -14,10 +14,10 @@ ${search} - ${tracks class="list-group"} + ${tracks}
- ${show-more class="btn-primary"} + ${show-more class="btn-primary Lms-show-more"}
diff --git a/docroot/css/lms.css b/docroot/css/lms.css index 4d90cf9b..0d16eb23 100644 --- a/docroot/css/lms.css +++ b/docroot/css/lms.css @@ -18,6 +18,10 @@ a:hover { justify-content: center; } +.Lms-show-more { + margin-top: 8px; + margin-bottom: 8px; +} .Lms-cluster { display: inline; diff --git a/src/ui/LmsApplication.cpp b/src/ui/LmsApplication.cpp index 2fed4fb0..b231940a 100644 --- a/src/ui/LmsApplication.cpp +++ b/src/ui/LmsApplication.cpp @@ -534,6 +534,12 @@ static std::string msgTypeToString(MsgType type) return ""; } +void +LmsApplication::post(std::function func) +{ + Wt::WServer::instance()->post(LmsApp->sessionId(), func); +} + void LmsApplication::notifyMsg(MsgType type, const Wt::WString& message, std::chrono::milliseconds duration) { diff --git a/src/ui/LmsApplication.hpp b/src/ui/LmsApplication.hpp index 5f301920..5bb3eb31 100644 --- a/src/ui/LmsApplication.hpp +++ b/src/ui/LmsApplication.hpp @@ -79,6 +79,7 @@ class LmsApplication : public Wt::WApplication void goHome(); void goHomeAndQuit(); + void post(std::function 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); diff --git a/src/ui/PlayQueueView.cpp b/src/ui/PlayQueueView.cpp index b5eb0bbf..d2296971 100644 --- a/src/ui/PlayQueueView.cpp +++ b/src/ui/PlayQueueView.cpp @@ -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);