Use config.ServiceConfig across API

This commit is contained in:
Philipp Wolfer 2023-12-07 23:44:58 +01:00
parent 091b3c2f49
commit 9c363cc06d
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
27 changed files with 137 additions and 99 deletions

View file

@ -22,7 +22,7 @@ import (
"time"
"github.com/delucks/go-subsonic"
"github.com/spf13/viper"
"go.uploadedlobster.com/scotty/internal/config"
"go.uploadedlobster.com/scotty/internal/models"
"go.uploadedlobster.com/scotty/internal/version"
)
@ -50,7 +50,7 @@ func (b *SubsonicApiBackend) Options() *[]models.BackendOption {
}}
}
func (b *SubsonicApiBackend) FromConfig(config *viper.Viper) models.Backend {
func (b *SubsonicApiBackend) FromConfig(config *config.ServiceConfig) models.Backend {
b.client = subsonic.Client{
Client: &http.Client{},
BaseUrl: config.GetString("server-url"),