Added constants for app name and version, use custom user-agent

This commit is contained in:
Philipp Wolfer 2023-11-24 08:58:31 +01:00
parent f6b4ea4a46
commit 46e6a667c8
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
10 changed files with 75 additions and 6 deletions

View file

@ -24,6 +24,7 @@ import (
"github.com/delucks/go-subsonic"
"github.com/spf13/viper"
"go.uploadedlobster.com/scotty/internal/models"
"go.uploadedlobster.com/scotty/internal/version"
)
type SubsonicApiBackend struct {
@ -38,7 +39,7 @@ func (b *SubsonicApiBackend) FromConfig(config *viper.Viper) models.Backend {
Client: &http.Client{},
BaseUrl: config.GetString("server-url"),
User: config.GetString("username"),
ClientName: "Scotty",
ClientName: version.AppName,
}
b.password = config.GetString("token")
return b