From 36240d45820d60ffd51c313a9b368c3d97297ce6 Mon Sep 17 00:00:00 2001 From: Deluan Date: Sun, 5 Jul 2026 13:53:16 -0400 Subject: [PATCH] feat(jellyfin): add config flag and URL path constant Adds the disabled-by-default Server.Jellyfin config option (Enabled, ServerName) and consts.URLPathJellyfinAPI, following the existing LastFM/ListenBrainz patterns. Later tasks will use these to mount the Jellyfin-compatible API router. --- conf/configuration.go | 9 +++++++++ consts/consts.go | 1 + 2 files changed, 10 insertions(+) diff --git a/conf/configuration.go b/conf/configuration.go index 8646bf075..4f4a8957b 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -116,6 +116,7 @@ type configOptions struct { LastFM lastfmOptions `json:",omitzero"` Deezer deezerOptions `json:",omitzero"` ListenBrainz listenBrainzOptions `json:",omitzero"` + Jellyfin jellyfinOptions `json:",omitzero"` EnableScrobbleHistory bool Tags map[string]TagConf `json:",omitempty"` Agents string @@ -218,6 +219,11 @@ type listenBrainzOptions struct { TrackAlgorithm string } +type jellyfinOptions struct { + Enabled bool + ServerName string +} + type httpHeaderOptions struct { FrameOptions string } @@ -577,6 +583,7 @@ func disableExternalServices() { Server.LastFM.Enabled = false Server.Deezer.Enabled = false Server.ListenBrainz.Enabled = false + Server.Jellyfin.Enabled = false Server.Agents = "" if Server.UILoginBackgroundURL == consts.DefaultUILoginBackgroundURL { Server.UILoginBackgroundURL = consts.DefaultUILoginBackgroundURLOffline @@ -848,6 +855,8 @@ func setViperDefaults() { viper.SetDefault("listenbrainz.baseurl", consts.DefaultListenBrainzBaseURL) viper.SetDefault("listenbrainz.artistalgorithm", consts.DefaultListenBrainzArtistAlgorithm) viper.SetDefault("listenbrainz.trackalgorithm", consts.DefaultListenBrainzTrackAlgorithm) + viper.SetDefault("jellyfin.enabled", false) + viper.SetDefault("jellyfin.servername", consts.AppName) viper.SetDefault("enablescrobblehistory", true) viper.SetDefault("httpheaders.frameoptions", "DENY") viper.SetDefault("backup.path", "") diff --git a/consts/consts.go b/consts/consts.go index 3795b590a..481f94e2b 100644 --- a/consts/consts.go +++ b/consts/consts.go @@ -44,6 +44,7 @@ const ( URLPathSubsonicAPI = "/rest" URLPathPublic = "/share" URLPathPublicImages = URLPathPublic + "/img" + URLPathJellyfinAPI = "/jellyfin" // DefaultUILoginBackgroundURL uses Navidrome curated background images collection, // available at https://unsplash.com/collections/20072696/navidrome