Remove lots of DB calls just for getting the current track. Add update call for vote closing. Add some code to try and avoid having current playing track show up in votes again.

This commit is contained in:
Kevin Whitaker
2017-02-08 21:30:23 -05:00
parent 1a545af49f
commit 39a780cb95
2 changed files with 54 additions and 17 deletions

View File

@@ -47,6 +47,7 @@ public:
struct GroovePlaylist* currentPlaylist;
struct GroovePlayer* currentPlayer;
AudioTrack currentTrack;
std::list<AudioTrack> currentVoteBatch;
std::list<std::pair<AudioTrack, int>> currentVoteStatus;
bool voteEndedButNotNextTrackYet = false;
@@ -73,7 +74,7 @@ private:
PlayerEvents getNextPlayerEvent(Wt::Dbo::Session* session);
void removeOrphanedTracks(Wt::Dbo::Session* session);
AudioTrack getCurrentTrack(Wt::Dbo::Session* session);
AudioTrack getCurrentTrackDB(Wt::Dbo::Session* session);
void getPictureFromTrack(AudioTrack* trackToFill);
};