spotify-history: min. playback time for skipped tracks is now in seconds

This commit is contained in:
Philipp Wolfer 2024-01-14 22:22:00 +01:00
parent 01380bd730
commit 60bbbb9f15
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
2 changed files with 15 additions and 15 deletions

View file

@ -28,9 +28,9 @@ import (
type StreamingHistory []HistoryItem
type ListenListOptions struct {
IgnoreIncognito bool
IgnoreSkipped bool
SkippedMinDurationMs int
IgnoreIncognito bool
IgnoreSkipped bool
skippedMinSeconds int
}
type HistoryItem struct {
@ -72,7 +72,7 @@ func (h *StreamingHistory) AsListenList(opt ListenListOptions) models.ListensLis
if item.MasterMetadataTrackName == "" ||
(opt.IgnoreIncognito && item.IncognitoMode) ||
(opt.IgnoreSkipped && item.Skipped) ||
(item.Skipped && item.MillisecondsPlayed < opt.SkippedMinDurationMs) {
(item.Skipped && item.MillisecondsPlayed < opt.skippedMinSeconds*1000) {
continue
}
listens = append(listens, item.AsListen())