mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-07 09:54:55 +00:00
Update scrobble logic to post after 25% of the track has played, not 10 seconds.
This commit is contained in:
parent
c86230d3aa
commit
3cd6bc165f
@ -508,13 +508,14 @@ void PlaybackService::OnTrackChanged(size_t pos, TrackPtr track) {
|
||||
|
||||
/* we consider a track to be played if (1) it enters the playing state and
|
||||
it's less than 10 seconds long, or (2) it enters the playing state, and
|
||||
remains playing for > 10 seconds */
|
||||
remains playing for > 25% of its duration seconds */
|
||||
const double duration = this->transport->GetDuration();
|
||||
if (duration > 0 && duration < 10.0) {
|
||||
this->MarkTrackAsPlayed(track->GetId());
|
||||
}
|
||||
else {
|
||||
POST_DELAYED(this, MESSAGE_MARK_TRACK_PLAYED, track->GetId(), 0, 10000LL);
|
||||
const int64_t delay = (int64_t)(duration * 0.25f);
|
||||
POST_DELAYED(this, MESSAGE_MARK_TRACK_PLAYED, track->GetId(), 0, delay);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user