Skip to content

Commit

Permalink
Adjusted MainWindow::TrackSkipped to only count song skips if listene…
Browse files Browse the repository at this point in the history
…d to for 5 seconds.
  • Loading branch information
officereso authored and hatstand committed Sep 13, 2023
1 parent 2a14ec9 commit de7455e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1262,10 +1262,14 @@ void MainWindow::TrackSkipped(PlaylistItemPtr item) {

const qint64 seconds_left = (length - position) / kNsecPerSec;
const qint64 seconds_total = length / kNsecPerSec;
const qint64 seconds_listened = position / kNsecPerSec;

if (((0.05 * seconds_total > 60 && percentage < 0.98) ||
percentage < 0.95) &&
seconds_left > 5) { // Never count the skip if under 5 seconds left
(seconds_left > 5 &&
5 < seconds_listened)) { // Never count the skip if under 5 seconds
// left. Or we haven't listened for more than
// 5 seconds.
app_->library_backend()->IncrementSkipCountAsync(song.id(), percentage);
}
}
Expand Down

0 comments on commit de7455e

Please sign in to comment.