mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-27 14:47:55 +02:00
spotifyhistory: configurable min duration for skipped tracks
This commit is contained in:
parent
97e93553a1
commit
925c21893b
1 changed files with 6 additions and 1 deletions
|
@ -56,6 +56,11 @@ func (b *SpotifyHistoryBackend) Options() []models.BackendOption {
|
||||||
Label: i18n.Tr("Ignore skipped listens"),
|
Label: i18n.Tr("Ignore skipped listens"),
|
||||||
Type: models.Bool,
|
Type: models.Bool,
|
||||||
Default: "false",
|
Default: "false",
|
||||||
|
}, {
|
||||||
|
Name: "ignore-min-duration-ms",
|
||||||
|
Label: i18n.Tr("Minimum playback duration for skipped tracks (milliseconds)"),
|
||||||
|
Type: models.Int,
|
||||||
|
Default: "30000",
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +68,7 @@ func (b *SpotifyHistoryBackend) FromConfig(config *config.ServiceConfig) models.
|
||||||
b.dirPath = config.GetString("dir-path")
|
b.dirPath = config.GetString("dir-path")
|
||||||
b.ignoreIncognito = config.GetBool("ignore-incognito", true)
|
b.ignoreIncognito = config.GetBool("ignore-incognito", true)
|
||||||
b.ignoreSkipped = config.GetBool("ignore-skipped", false)
|
b.ignoreSkipped = config.GetBool("ignore-skipped", false)
|
||||||
b.skippedMinDurationMs = 30000
|
b.skippedMinDurationMs = config.GetInt("ignore-min-duration-ms", 30000)
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue