mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-23 10:29:46 +01:00
feat: add configurable visibility control for NowPlaying feature
Replaces the boolean EnableNowPlaying option with a more flexible NowPlaying configuration structure containing Enabled and AdminOnly flags. This allows three visibility modes: disabled, admin-only, and all users. The new configuration uses nowplayingOptions struct similar to jukeboxOptions, with the following defaults: - NowPlaying.Enabled: true (feature enabled) - NowPlaying.AdminOnly: false (visible to all users) The old EnableNowPlaying option is deprecated and automatically migrated to NowPlaying.Enabled with a warning message. Frontend changes update the AppBar component to conditionally render NowPlayingPanel based on both the enabled state and the admin-only permission check. Server-side enforcement of the AdminOnly setting is added in a follow-up commit. Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
05105e91d9
commit
08e632d918
9 changed files with 36 additions and 12 deletions
|
|
@ -57,7 +57,8 @@ func serveIndex(ds model.DataStore, fs fs.FS, shareInfo *model.Share) http.Handl
|
|||
"uiSearchDebounceMs": conf.Server.UISearchDebounceMs,
|
||||
"uiCoverArtSize": conf.Server.UICoverArtSize,
|
||||
"enableCoverAnimation": conf.Server.EnableCoverAnimation,
|
||||
"enableNowPlaying": conf.Server.EnableNowPlaying,
|
||||
"enableNowPlaying": conf.Server.NowPlaying.Enabled,
|
||||
"nowPlayingAdminOnly": conf.Server.NowPlaying.AdminOnly,
|
||||
"playbackReportIntervalMs": conf.Server.UIPlaybackReportInterval.Milliseconds(),
|
||||
"gaTrackingId": conf.Server.GATrackingID,
|
||||
"losslessFormats": strings.ToUpper(strings.Join(mime.LosslessFormats, ",")),
|
||||
|
|
|
|||
|
|
@ -88,7 +88,8 @@ var _ = Describe("serveIndex", func() {
|
|||
Entry("uiSearchDebounceMs", func() { conf.Server.UISearchDebounceMs = 500 }, "uiSearchDebounceMs", float64(500)),
|
||||
Entry("uiCoverArtSize", func() { conf.Server.UICoverArtSize = 300 }, "uiCoverArtSize", float64(300)),
|
||||
Entry("enableCoverAnimation", func() { conf.Server.EnableCoverAnimation = true }, "enableCoverAnimation", true),
|
||||
Entry("enableNowPlaying", func() { conf.Server.EnableNowPlaying = true }, "enableNowPlaying", true),
|
||||
Entry("enableNowPlaying", func() { conf.Server.NowPlaying.Enabled = true }, "enableNowPlaying", true),
|
||||
Entry("nowPlayingAdminOnly", func() { conf.Server.NowPlaying.AdminOnly = true }, "nowPlayingAdminOnly", true),
|
||||
Entry("gaTrackingId", func() { conf.Server.GATrackingID = "UA-12345" }, "gaTrackingId", "UA-12345"),
|
||||
Entry("defaultDownloadableShare", func() { conf.Server.DefaultDownloadableShare = true }, "defaultDownloadableShare", true),
|
||||
Entry("devSidebarPlaylists", func() { conf.Server.DevSidebarPlaylists = true }, "devSidebarPlaylists", true),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue