Dynamic per-backend configuration options

This commit is contained in:
Philipp Wolfer 2023-12-05 23:25:15 +01:00
parent ae5f1c5f26
commit c9fa21be73
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
14 changed files with 262 additions and 17 deletions

View file

@ -36,6 +36,26 @@ type JSPFBackend struct {
func (b *JSPFBackend) Name() string { return "jspf" }
func (b *JSPFBackend) Options() *[]models.BackendOption {
return &[]models.BackendOption{{
Name: "file-path",
Label: "File path",
Type: models.String,
}, {
Name: "title",
Label: "Playlist title",
Type: models.String,
}, {
Name: "username",
Label: "User name",
Type: models.String,
}, {
Name: "identifier",
Label: "Unique playlist identifier",
Type: models.String,
}}
}
func (b *JSPFBackend) FromConfig(config *viper.Viper) models.Backend {
b.filePath = config.GetString("file-path")
b.title = config.GetString("title")