Stop using pointers from DB as storage mechanism. Start storing copies of the object itself. Use commits after methods are done with transaction to hopefully help with DB issues. Don't use map because it requires too much about the key object I don't need. Add boolean that prevents vote end from being called constantly during it's 3 second window.

This commit is contained in:
Kevin Whitaker
2017-02-05 18:20:03 -05:00
parent 75c87c41f8
commit cb5b2f7ad6
4 changed files with 71 additions and 61 deletions

View File

@@ -57,31 +57,31 @@ void WebInterface::loginCompleted()
//TODO: request current player state.
}
void WebInterface::playPauseActionFromServer(User* userPausing)
void WebInterface::playPauseActionFromServer(User userPausing)
{
priv_int->playerUI->tempText->setText(priv_int->playerUI->tempText->text()+"play");
triggerUpdate();
}
void WebInterface::songChangedFromServer(const AudioTrack* nextTrack)
void WebInterface::songChangedFromServer(AudioTrack nextTrack)
{
priv_int->playerUI->tempText->setText(priv_int->playerUI->tempText->text()+"change");
triggerUpdate();
}
void WebInterface::skipVotedFromServer(User* userRequestingToSkipCurrentTrack)
void WebInterface::skipVotedFromServer(User userRequestingToSkipCurrentTrack)
{
priv_int->playerUI->tempText->setText(priv_int->playerUI->tempText->text()+"skip");
triggerUpdate();
}
void WebInterface::voteUpdateFromServer(User* userVoting, bool forSkip)
void WebInterface::voteUpdateFromServer(User userVoting, bool forSkip)
{
priv_int->playerUI->tempText->setText(priv_int->playerUI->tempText->text()+"vote");
triggerUpdate();
}
void WebInterface::voteNextSongFromServer(User* userVoting, const AudioTrack* trackVoted)
void WebInterface::voteNextSongFromServer(User userVoting, AudioTrack trackVoted)
{
priv_int->playerUI->tempText->setText(priv_int->playerUI->tempText->text()+"nextvote");
triggerUpdate();
@@ -93,7 +93,7 @@ void WebInterface::voteNextPollClosedFromServer()
triggerUpdate();
}
void WebInterface::voteTracksUpdatedFromServer(std::list<const AudioTrack *> voteableTracks)
void WebInterface::voteTracksUpdatedFromServer(std::list<AudioTrack> voteableTracks)
{
priv_int->playerUI->tempText->setText(priv_int->playerUI->tempText->text()+"votechanged");
triggerUpdate();