mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 05:37:05 +02:00
Dynamic per-backend configuration options
This commit is contained in:
parent
ae5f1c5f26
commit
c9fa21be73
14 changed files with 262 additions and 17 deletions
|
@ -36,6 +36,22 @@ type ScrobblerLogBackend struct {
|
|||
|
||||
func (b *ScrobblerLogBackend) Name() string { return "scrobbler-log" }
|
||||
|
||||
func (b *ScrobblerLogBackend) Options() *[]models.BackendOption {
|
||||
return &[]models.BackendOption{{
|
||||
Name: "file-path",
|
||||
Label: "File path",
|
||||
Type: models.String,
|
||||
}, {
|
||||
Name: "include-skipped",
|
||||
Label: "Include skipped listens",
|
||||
Type: models.Bool,
|
||||
}, {
|
||||
Name: "append",
|
||||
Label: "Append to file",
|
||||
Type: models.Bool,
|
||||
}}
|
||||
}
|
||||
|
||||
func (b *ScrobblerLogBackend) FromConfig(config *viper.Viper) models.Backend {
|
||||
b.filePath = config.GetString("file-path")
|
||||
b.includeSkipped = config.GetBool("include-skipped")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue