🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
feat(server): group Subsonic config options together
Deluan8ab2a11d227d
diff --git a/conf/configuration.go b/conf/configuration.goindex d5e9b407b..88e1838fc 100644--- a/conf/configuration.go+++ b/conf/configuration.go@@ -59,8 +59,6 @@ type configOptions struct {PreferSortTags boolIgnoredArticles stringIndexGroups string- SubsonicArtistParticipations bool- DefaultReportRealPath boolFFmpegPath stringMPVPath stringMPVCmdTemplate string@@ -93,6 +91,7 @@ type configOptions struct {Backup backupOptionsPID pidOptionsInspect inspectOptions+ Subsonic subsonicOptionsAgents stringLastFM lastfmOptions@@ -121,7 +120,6 @@ type configOptions struct {DevScannerThreads uintDevInsightsInitialDelay time.DurationDevEnablePlayerInsights bool- DevOpenSubsonicDisabledClients string}type scannerOptions struct {@@ -133,6 +131,12 @@ type scannerOptions struct {GroupAlbumReleases bool // Deprecated: BFR Update docs}+type subsonicOptions struct {+ ArtistParticipations bool+ DefaultReportRealPath bool+ LegacyClients string+}+type TagConf struct {Aliases []string `yaml:"aliases"`Type string `yaml:"type"`@@ -431,8 +435,6 @@ func init() {viper.SetDefault("prefersorttags", false)viper.SetDefault("ignoredarticles", "The El La Los Las Le Les Os As O A")viper.SetDefault("indexgroups", "A B C D E F G H I J K L M N O P Q R S T U V W X-Z(XYZ) [Unknown]([)")- viper.SetDefault("subsonicartistparticipations", false)- viper.SetDefault("defaultreportrealpath", false)viper.SetDefault("ffmpegpath", "")viper.SetDefault("mpvcmdtemplate", "mpv --audio-device=%d --no-audio-display --pause %f --input-ipc-server=%s")@@ -477,6 +479,10 @@ func init() {viper.SetDefault("scanner.watcherwait", consts.DefaultWatcherWait)viper.SetDefault("scanner.scanonstartup", true)+ viper.SetDefault("subsonic.artistparticipations", false)+ viper.SetDefault("subsonic.defaultreportrealpath", false)+ viper.SetDefault("subsonic.legacyclients", "DSub")+viper.SetDefault("agents", "lastfm,spotify")viper.SetDefault("lastfm.enabled", true)viper.SetDefault("lastfm.language", "en")@@ -521,7 +527,6 @@ func init() {viper.SetDefault("devscannerthreads", 5)viper.SetDefault("devinsightsinitialdelay", consts.InsightsInitialDelay)viper.SetDefault("devenableplayerinsights", true)- viper.SetDefault("devopensubsonicdisabledclients", "DSub")}func InitConfig(cfgFile string) {diff --git a/core/players.go b/core/players.goindex 1cba4893b..963914514 100644--- a/core/players.go+++ b/core/players.go@@ -53,7 +53,7 @@ func (p *players) Register(ctx context.Context, playerID, client, userAgent, ipUserId: user.ID,Client: client,ScrobbleEnabled: true,- ReportRealPath: conf.Server.DefaultReportRealPath,+ ReportRealPath: conf.Server.Subsonic.DefaultReportRealPath,}log.Info(ctx, "Registering new player", "id", plr.ID, "client", client, "username", username, "type", userAgent)}diff --git a/server/subsonic/filter/filters.go b/server/subsonic/filter/filters.goindex b50f99029..1cac0b674 100644--- a/server/subsonic/filter/filters.go+++ b/server/subsonic/filter/filters.go@@ -50,7 +50,7 @@ func AlbumsByArtistID(artistId string) Options {filters := []Sqlizer{persistence.Exists("json_tree(Participants, '$.albumartist')", Eq{"value": artistId}),}- if conf.Server.SubsonicArtistParticipations {+ if conf.Server.Subsonic.ArtistParticipations {filters = append(filters,persistence.Exists("json_tree(Participants, '$.artist')", Eq{"value": artistId}),)diff --git a/server/subsonic/helpers.go b/server/subsonic/helpers.goindex bb6f2dfd4..01d876d19 100644--- a/server/subsonic/helpers.go+++ b/server/subsonic/helpers.go@@ -110,7 +110,7 @@ func toArtistID3(r *http.Request, a model.Artist) responses.ArtistID3 {func toOSArtistID3(ctx context.Context, a model.Artist) *responses.OpenSubsonicArtistID3 {player, _ := request.PlayerFrom(ctx)- if strings.Contains(conf.Server.DevOpenSubsonicDisabledClients, player.Client) {+ if strings.Contains(conf.Server.Subsonic.LegacyClients, player.Client) {return nil}artist := responses.OpenSubsonicArtistID3{@@ -197,7 +197,7 @@ func childFromMediaFile(ctx context.Context, mf model.MediaFile) responses.Childfunc osChildFromMediaFile(ctx context.Context, mf model.MediaFile) *responses.OpenSubsonicChild {player, _ := request.PlayerFrom(ctx)- if strings.Contains(conf.Server.DevOpenSubsonicDisabledClients, player.Client) {+ if strings.Contains(conf.Server.Subsonic.LegacyClients, player.Client) {return nil}child := responses.OpenSubsonicChild{}@@ -301,7 +301,7 @@ func childFromAlbum(ctx context.Context, al model.Album) responses.Child {func osChildFromAlbum(ctx context.Context, al model.Album) *responses.OpenSubsonicChild {player, _ := request.PlayerFrom(ctx)- if strings.Contains(conf.Server.DevOpenSubsonicDisabledClients, player.Client) {+ if strings.Contains(conf.Server.Subsonic.LegacyClients, player.Client) {return nil}child := responses.OpenSubsonicChild{}@@ -376,7 +376,7 @@ func buildAlbumID3(ctx context.Context, album model.Album) responses.AlbumID3 {func buildOSAlbumID3(ctx context.Context, album model.Album) *responses.OpenSubsonicAlbumID3 {player, _ := request.PlayerFrom(ctx)- if strings.Contains(conf.Server.DevOpenSubsonicDisabledClients, player.Client) {+ if strings.Contains(conf.Server.Subsonic.LegacyClients, player.Client) {return nil}dir := responses.OpenSubsonicAlbumID3{}