feat(server): group Subsonic config options together

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan 2025-03-05 12:29:30 -08:00
parent 637c909e93
commit 8ab2a11d22
4 changed files with 17 additions and 12 deletions

View file

@ -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}),
)

View file

@ -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.Child
func 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{}