Prevent demo user from saving radio/repeat states

This commit is contained in:
emeric
2018-10-08 13:37:25 +02:00
parent ec852f8a2f
commit 8ec87c9346
+8
View File
@@ -81,6 +81,8 @@ PlayQueue::PlayQueue()
updateRepeatBtn();
Wt::Dbo::Transaction transaction(LmsApp->getDboSession());
if (!LmsApp->getUser()->isDemo())
LmsApp->getUser().modify()->setRepeatAll(_repeatAll);
});
updateRepeatBtn();
@@ -93,6 +95,8 @@ PlayQueue::PlayQueue()
updateRadioBtn();
Wt::Dbo::Transaction transaction(LmsApp->getDboSession());
if (!LmsApp->getUser()->isDemo())
LmsApp->getUser().modify()->setRadio(_radioMode);
});
updateRadioBtn();
@@ -116,6 +120,9 @@ PlayQueue::PlayQueue()
updateInfo();
addSome();
{
Wt::Dbo::Transaction transaction(LmsApp->getDboSession());
if (!LmsApp->getUser()->isDemo())
{
LmsApp->post([=]
@@ -124,6 +131,7 @@ PlayQueue::PlayQueue()
});
}
}
}
void
PlayQueue::updateRepeatBtn()