Prevent demo user from saving radio/repeat states
This commit is contained in:
@@ -81,6 +81,8 @@ PlayQueue::PlayQueue()
|
|||||||
updateRepeatBtn();
|
updateRepeatBtn();
|
||||||
|
|
||||||
Wt::Dbo::Transaction transaction(LmsApp->getDboSession());
|
Wt::Dbo::Transaction transaction(LmsApp->getDboSession());
|
||||||
|
|
||||||
|
if (!LmsApp->getUser()->isDemo())
|
||||||
LmsApp->getUser().modify()->setRepeatAll(_repeatAll);
|
LmsApp->getUser().modify()->setRepeatAll(_repeatAll);
|
||||||
});
|
});
|
||||||
updateRepeatBtn();
|
updateRepeatBtn();
|
||||||
@@ -93,6 +95,8 @@ PlayQueue::PlayQueue()
|
|||||||
updateRadioBtn();
|
updateRadioBtn();
|
||||||
|
|
||||||
Wt::Dbo::Transaction transaction(LmsApp->getDboSession());
|
Wt::Dbo::Transaction transaction(LmsApp->getDboSession());
|
||||||
|
|
||||||
|
if (!LmsApp->getUser()->isDemo())
|
||||||
LmsApp->getUser().modify()->setRadio(_radioMode);
|
LmsApp->getUser().modify()->setRadio(_radioMode);
|
||||||
});
|
});
|
||||||
updateRadioBtn();
|
updateRadioBtn();
|
||||||
@@ -116,6 +120,9 @@ PlayQueue::PlayQueue()
|
|||||||
updateInfo();
|
updateInfo();
|
||||||
addSome();
|
addSome();
|
||||||
|
|
||||||
|
{
|
||||||
|
Wt::Dbo::Transaction transaction(LmsApp->getDboSession());
|
||||||
|
|
||||||
if (!LmsApp->getUser()->isDemo())
|
if (!LmsApp->getUser()->isDemo())
|
||||||
{
|
{
|
||||||
LmsApp->post([=]
|
LmsApp->post([=]
|
||||||
@@ -123,6 +130,7 @@ PlayQueue::PlayQueue()
|
|||||||
load(LmsApp->getUser()->getCurPlayingTrackPos(), false);
|
load(LmsApp->getUser()->getCurPlayingTrackPos(), false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user