AMWin-RP icon indicating copy to clipboard operation
AMWin-RP copied to clipboard

Better minimum scrobble duration settings

Open swiffyjk opened this issue 6 months ago • 1 comments

The last.fm docs recommend that a scrobble be considered valid when the track has either passed 50% of its duration or 4 minutes of its duration, whichever comes first. Currently, there's only a seconds option which is inconsistent.
I also think it should be possible to enable a 'Scrobble Short Tracks' option like Marvis Pro, so people can choose if they want tracks shorter than 30 seconds to be scrobbled.

swiffyjk avatar Jul 09 '25 16:07 swiffyjk

The "Max time before scrobble" option in the settings basically parametrises the "4 minutes" part of the last.fm guidelines.

protected bool IsTimeToScrobble(AppleMusicInfo info) {
    if (info.SongDuration.HasValue && info.SongDuration.Value >= 30) { // we should only scrobble tracks with more than 30 seconds
        double halfSongDuration = info.SongDuration.Value / 2;
        return elapsedSeconds >= halfSongDuration || elapsedSeconds >= Properties.Settings.Default.ScrobbleMaxWait; // half the song has passed or more than 4 minutes
    }
    return elapsedSeconds > Constants.LastFMTimeBeforeScrobbling;
}

so setting this value to X seconds means the song is scrobbled when either half the duration has passed or X seconds has passed.

However, I agree a setting could be added to make the 30 second threshold configurable.

PKBeam avatar Oct 26 '25 12:10 PKBeam