Prevent demo user from saving radio/repeat states
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user