mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 13:47:05 +02:00
scrobblerlog: renamed setting include-skipped to ignore-skipped
This makes the setting consistent with the similar setting for spotify
This commit is contained in:
parent
82858315fa
commit
1516a3a9d6
4 changed files with 25 additions and 25 deletions
|
@ -31,12 +31,12 @@ import (
|
|||
)
|
||||
|
||||
type ScrobblerLogBackend struct {
|
||||
filePath string
|
||||
includeSkipped bool
|
||||
append bool
|
||||
file *os.File
|
||||
timezone *time.Location
|
||||
log scrobblerlog.ScrobblerLog
|
||||
filePath string
|
||||
ignoreSkipped bool
|
||||
append bool
|
||||
file *os.File
|
||||
timezone *time.Location
|
||||
log scrobblerlog.ScrobblerLog
|
||||
}
|
||||
|
||||
func (b *ScrobblerLogBackend) Name() string { return "scrobbler-log" }
|
||||
|
@ -47,9 +47,10 @@ func (b *ScrobblerLogBackend) Options() []models.BackendOption {
|
|||
Label: i18n.Tr("File path"),
|
||||
Type: models.String,
|
||||
}, {
|
||||
Name: "include-skipped",
|
||||
Label: i18n.Tr("Include skipped listens"),
|
||||
Type: models.Bool,
|
||||
Name: "ignore-skipped",
|
||||
Label: i18n.Tr("Ignore skipped listens"),
|
||||
Type: models.Bool,
|
||||
Default: "true",
|
||||
}, {
|
||||
Name: "append",
|
||||
Label: i18n.Tr("Append to file"),
|
||||
|
@ -64,7 +65,7 @@ func (b *ScrobblerLogBackend) Options() []models.BackendOption {
|
|||
|
||||
func (b *ScrobblerLogBackend) InitConfig(config *config.ServiceConfig) error {
|
||||
b.filePath = config.GetString("file-path")
|
||||
b.includeSkipped = config.GetBool("include-skipped", false)
|
||||
b.ignoreSkipped = config.GetBool("ignore-skipped", true)
|
||||
b.append = config.GetBool("append", true)
|
||||
timezone := config.GetString("time-zone")
|
||||
if timezone != "" {
|
||||
|
@ -140,7 +141,7 @@ func (b *ScrobblerLogBackend) ExportListens(oldestTimestamp time.Time, results c
|
|||
|
||||
defer file.Close()
|
||||
|
||||
err = b.log.Parse(file, b.includeSkipped)
|
||||
err = b.log.Parse(file, b.ignoreSkipped)
|
||||
if err != nil {
|
||||
progress <- models.Progress{}.Complete()
|
||||
results <- models.ListensResult{Error: err}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue