Adjusted MainWindow::TrackSkipped to only count song skips if listened to for 5 seconds.

This commit is contained in:
Quentin Snow 2023-09-12 14:46:50 -05:00 committed by John Maguire
parent 2a14ec9d4d
commit de7455eebd
1 changed files with 5 additions and 1 deletions

View File

@ -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);
}
}