Now reloading the playqueue at startup, better styling the show more button
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@
|
|||||||
${artists}
|
${artists}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 Lms-horizontal-center">
|
<div class="col-xs-12 Lms-horizontal-center">
|
||||||
${show-more class="btn-primary"}
|
${show-more class="btn-primary Lms-show-more"}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</message>
|
</message>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
${entries}
|
${entries}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 Lms-horizontal-center">
|
<div class="col-xs-12 Lms-horizontal-center">
|
||||||
${show-more class="btn-primary"}
|
${show-more class="btn-primary Lms-show-more"}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</message>
|
</message>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
${entries}
|
${entries}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 Lms-horizontal-center">
|
<div class="col-xs-12 Lms-horizontal-center">
|
||||||
${show-more class="btn-primary"}
|
${show-more class="btn-primary Lms-show-more"}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</message>
|
</message>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
${releases}
|
${releases}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 Lms-horizontal-center">
|
<div class="col-xs-12 Lms-horizontal-center">
|
||||||
${show-more class="btn-primary"}
|
${show-more class="btn-primary Lms-show-more"}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</message>
|
</message>
|
||||||
|
|||||||
+2
-2
@@ -14,10 +14,10 @@
|
|||||||
${search}
|
${search}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
${tracks class="list-group"}
|
${tracks}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 Lms-horizontal-center">
|
<div class="col-xs-12 Lms-horizontal-center">
|
||||||
${show-more class="btn-primary"}
|
${show-more class="btn-primary Lms-show-more"}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</message>
|
</message>
|
||||||
|
|||||||
@@ -18,6 +18,10 @@ a:hover {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.Lms-show-more {
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
.Lms-cluster {
|
.Lms-cluster {
|
||||||
display: inline;
|
display: inline;
|
||||||
|
|||||||
@@ -534,6 +534,12 @@ static std::string msgTypeToString(MsgType type)
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LmsApplication::post(std::function<void()> func)
|
||||||
|
{
|
||||||
|
Wt::WServer::instance()->post(LmsApp->sessionId(), func);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LmsApplication::notifyMsg(MsgType type, const Wt::WString& message, std::chrono::milliseconds duration)
|
LmsApplication::notifyMsg(MsgType type, const Wt::WString& message, std::chrono::milliseconds duration)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ class LmsApplication : public Wt::WApplication
|
|||||||
void goHome();
|
void goHome();
|
||||||
void goHomeAndQuit();
|
void goHomeAndQuit();
|
||||||
|
|
||||||
|
void post(std::function<void()> func);
|
||||||
void notifyMsg(MsgType type, const Wt::WString& message, std::chrono::milliseconds duration = std::chrono::milliseconds(4000));
|
void notifyMsg(MsgType type, const Wt::WString& message, std::chrono::milliseconds duration = std::chrono::milliseconds(4000));
|
||||||
|
|
||||||
static Wt::WLink createArtistLink(Database::Artist::pointer artist);
|
static Wt::WLink createArtistLink(Database::Artist::pointer artist);
|
||||||
|
|||||||
@@ -86,6 +86,14 @@ PlayQueue::PlayQueue()
|
|||||||
|
|
||||||
updateInfo();
|
updateInfo();
|
||||||
addSome();
|
addSome();
|
||||||
|
|
||||||
|
if (!LmsApp->getUser()->isDemo())
|
||||||
|
{
|
||||||
|
LmsApp->post([=]
|
||||||
|
{
|
||||||
|
play(LmsApp->getUser()->getCurPlayingTrackPos());
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Database::TrackList::pointer
|
Database::TrackList::pointer
|
||||||
@@ -157,6 +165,9 @@ PlayQueue::play(std::size_t pos)
|
|||||||
trackId = track.id();
|
trackId = track.id();
|
||||||
|
|
||||||
updateCurrentTrack(true);
|
updateCurrentTrack(true);
|
||||||
|
|
||||||
|
if (!LmsApp->getUser()->isDemo())
|
||||||
|
LmsApp->getUser().modify()->setCurPlayingTrackPos(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
playTrack.emit(trackId);
|
playTrack.emit(trackId);
|
||||||
|
|||||||
Reference in New Issue
Block a user