Skip to content

Commit

Permalink
write progress on playlist and play state changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronson Mathews committed Aug 13, 2020
1 parent 3406c49 commit f4817d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ void Player::exitHandler()

void Player::playlistIndexChanged(int xIndex)
{
// save book progress
Database::instance()->writeBook(*mCurrentBook);
emit currentIndexChanged(xIndex);
}

Expand All @@ -172,6 +174,8 @@ void Player::togglePlayPause() {
QMediaPlayer::play();
} else {
QMediaPlayer::pause();
// save book progress
Database::instance()->writeBook(*mCurrentBook);
}
}

Expand Down

0 comments on commit f4817d0

Please sign in to comment.