Uncomment user actions and fix by finding active DB object instead of converting dead one. Use font-awesome to make icons for buttons. Implement rest of basic logic for login page. Some style fixings. Start adding skip controls.
This commit is contained in:
@@ -355,8 +355,8 @@ void GroovePlayerMgr::grooveEventLoop()
|
||||
Wt::Dbo::Transaction voteTransaction(sqlSession);
|
||||
UserAction* action = new UserAction();
|
||||
action->action = UserAction::UAction::VoteTrack;
|
||||
action->user = Wt::Dbo::ptr<User>(&event.userInvolved);
|
||||
action->trackInvolved = Wt::Dbo::ptr<AudioTrack>(&event.tracksInvolved.front());
|
||||
action->user = sqlSession.find<User>().where("username = ?").bind(event.userInvolved.username);
|
||||
action->trackInvolved = sqlSession.find<AudioTrack>().where("fingerprint = ?").bind(event.tracksInvolved.front().trackFingerprint);
|
||||
action->datetime = Wt::WDateTime::currentDateTime();
|
||||
sqlSession.add(action);
|
||||
voteTransaction.commit();
|
||||
@@ -383,15 +383,15 @@ void GroovePlayerMgr::grooveEventLoop()
|
||||
}
|
||||
else if(event.eventType == PLAYING_PAUSED)
|
||||
{
|
||||
//Add action to DB TODO
|
||||
// Wt::Dbo::Transaction pauseTransaction(sqlSession);
|
||||
// UserAction* action = new UserAction();
|
||||
// action->action = UserAction::UAction::PlayPause;
|
||||
// action->user = Wt::Dbo::ptr<User>(&event.userInvolved);
|
||||
// action->trackInvolved = Wt::Dbo::ptr<AudioTrack>(&event.tracksInvolved.front());
|
||||
// action->datetime = Wt::WDateTime::currentDateTime();
|
||||
// sqlSession.add(action);
|
||||
// pauseTransaction.commit();
|
||||
//Add action to DB
|
||||
Wt::Dbo::Transaction pauseTransaction(sqlSession);
|
||||
UserAction* action = new UserAction();
|
||||
action->action = UserAction::UAction::PlayPause;
|
||||
action->user = sqlSession.find<User>().where("username = ?").bind(event.userInvolved.username);
|
||||
action->trackInvolved = sqlSession.find<AudioTrack>().where("fingerprint = ?").bind(event.tracksInvolved.front().trackFingerprint);
|
||||
action->datetime = Wt::WDateTime::currentDateTime();
|
||||
sqlSession.add(action);
|
||||
pauseTransaction.commit();
|
||||
|
||||
groove_playlist_pause(currentPlaylist);
|
||||
|
||||
@@ -407,15 +407,15 @@ void GroovePlayerMgr::grooveEventLoop()
|
||||
}
|
||||
else if(event.eventType == PLAYING_RESUMED)
|
||||
{
|
||||
//Add action to DB TODO
|
||||
// Wt::Dbo::Transaction playTransaction(sqlSession);
|
||||
// UserAction* action = new UserAction();
|
||||
// action->action = UserAction::UAction::PlayPause;
|
||||
// action->user = Wt::Dbo::ptr<User>(&event.userInvolved);
|
||||
// action->trackInvolved = Wt::Dbo::ptr<AudioTrack>(&event.tracksInvolved.front());
|
||||
// action->datetime = Wt::WDateTime::currentDateTime();
|
||||
// sqlSession.add(action);
|
||||
// playTransaction.commit();
|
||||
//Add action to DB
|
||||
Wt::Dbo::Transaction playTransaction(sqlSession);
|
||||
UserAction* action = new UserAction();
|
||||
action->action = UserAction::UAction::PlayPause;
|
||||
action->user = sqlSession.find<User>().where("username = ?").bind(event.userInvolved.username);
|
||||
action->trackInvolved = sqlSession.find<AudioTrack>().where("fingerprint = ?").bind(event.tracksInvolved.front().trackFingerprint);
|
||||
action->datetime = Wt::WDateTime::currentDateTime();
|
||||
sqlSession.add(action);
|
||||
playTransaction.commit();
|
||||
|
||||
groove_playlist_play(currentPlaylist);
|
||||
|
||||
@@ -439,8 +439,8 @@ void GroovePlayerMgr::grooveEventLoop()
|
||||
Wt::Dbo::Transaction skipTransaction(sqlSession);
|
||||
UserAction* action = new UserAction();
|
||||
action->action = UserAction::UAction::RequestSkip;
|
||||
action->user = Wt::Dbo::ptr<User>(&event.userInvolved);
|
||||
action->trackInvolved = Wt::Dbo::ptr<AudioTrack>(&event.tracksInvolved.front());
|
||||
action->user = sqlSession.find<User>().where("username = ?").bind(event.userInvolved.username);
|
||||
action->trackInvolved = sqlSession.find<AudioTrack>().where("fingerprint = ?").bind(event.tracksInvolved.front().trackFingerprint);
|
||||
action->datetime = Wt::WDateTime::currentDateTime();
|
||||
sqlSession.add(action);
|
||||
skipTransaction.commit();
|
||||
|
||||
Reference in New Issue
Block a user