Renamed Backend.FromConfig to Backend.InitConfig and added error handling

This commit is contained in:
Philipp Wolfer 2025-04-29 10:03:28 +02:00
parent aad542850a
commit 0f4b04c641
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
21 changed files with 60 additions and 48 deletions

View file

@ -52,7 +52,7 @@ func (b *SubsonicApiBackend) Options() []models.BackendOption {
}}
}
func (b *SubsonicApiBackend) FromConfig(config *config.ServiceConfig) models.Backend {
func (b *SubsonicApiBackend) InitConfig(config *config.ServiceConfig) error {
b.client = subsonic.Client{
Client: &http.Client{},
BaseUrl: config.GetString("server-url"),
@ -60,7 +60,7 @@ func (b *SubsonicApiBackend) FromConfig(config *config.ServiceConfig) models.Bac
ClientName: version.AppName,
}
b.password = config.GetString("token")
return b
return nil
}
func (b *SubsonicApiBackend) ExportLoves(oldestTimestamp time.Time, results chan models.LovesResult, progress chan models.Progress) {