🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Rename `DevEnableShare` to `EnableSharing`
Deluan68e611578997
diff --git a/conf/configuration.go b/conf/configuration.goindex 98ca5f268..c7a0f4ca3 100644--- a/conf/configuration.go+++ b/conf/configuration.go@@ -52,6 +52,7 @@ type configOptions struct {EnableFavourites boolEnableStarRating boolEnableUserEditing bool+ EnableSharing boolDefaultTheme stringDefaultLanguage stringDefaultUIVolume int@@ -78,7 +79,6 @@ type configOptions struct {DevAutoCreateAdminPassword stringDevAutoLoginUsername stringDevActivityPanel bool- DevEnableShare boolDevSidebarPlaylists boolDevEnableBufferedScrobble boolDevShowArtistPage bool@@ -282,7 +282,7 @@ func init() {viper.SetDefault("devautocreateadminpassword", "")viper.SetDefault("devautologinusername", "")viper.SetDefault("devactivitypanel", true)- viper.SetDefault("devenableshare", false)+ viper.SetDefault("enablesharing", false)viper.SetDefault("devenablebufferedscrobble", true)viper.SetDefault("devsidebarplaylists", true)viper.SetDefault("devshowartistpage", true)diff --git a/server/nativeapi/native_api.go b/server/nativeapi/native_api.goindex 8caa2d563..f3a58cf03 100644--- a/server/nativeapi/native_api.go+++ b/server/nativeapi/native_api.go@@ -45,7 +45,7 @@ func (n *Router) routes() http.Handler {n.R(r, "/playlist", model.Playlist{}, true)n.R(r, "/transcoding", model.Transcoding{}, conf.Server.EnableTranscodingConfig)n.R(r, "/radio", model.Radio{}, true)- if conf.Server.DevEnableShare {+ if conf.Server.EnableSharing {n.RX(r, "/share", n.share.NewRepository, true)}diff --git a/server/public/public_endpoints.go b/server/public/public_endpoints.goindex 34361b130..440fa7b1c 100644--- a/server/public/public_endpoints.go+++ b/server/public/public_endpoints.go@@ -38,7 +38,7 @@ func (p *Router) routes() http.Handler {r.Group(func(r chi.Router) {r.Use(server.URLParamsMiddleware)r.HandleFunc("/img/{id}", p.handleImages)- if conf.Server.DevEnableShare {+ if conf.Server.EnableSharing {r.HandleFunc("/s/{id}", p.handleStream)r.HandleFunc("/{id}", p.handleShares)r.HandleFunc("/", p.handleShares)diff --git a/server/serve_index.go b/server/serve_index.goindex e521edd4e..196a2de3c 100644--- a/server/serve_index.go+++ b/server/serve_index.go@@ -56,7 +56,7 @@ func serveIndex(ds model.DataStore, fs fs.FS, shareInfo *model.Share) http.Handl"losslessFormats": strings.ToUpper(strings.Join(consts.LosslessFormats, ",")),"devActivityPanel": conf.Server.DevActivityPanel,"enableUserEditing": conf.Server.EnableUserEditing,- "devEnableShare": conf.Server.DevEnableShare,+ "enableSharing": conf.Server.EnableSharing,"devSidebarPlaylists": conf.Server.DevSidebarPlaylists,"lastFMEnabled": conf.Server.LastFM.Enabled,"lastFMApiKey": conf.Server.LastFM.ApiKey,diff --git a/server/serve_index_test.go b/server/serve_index_test.goindex a714c83c3..6908be9fb 100644--- a/server/serve_index_test.go+++ b/server/serve_index_test.go@@ -224,14 +224,14 @@ var _ = Describe("serveIndex", func() {Expect(config).To(HaveKeyWithValue("enableUserEditing", true))})- It("sets the devEnableShare", func() {+ It("sets the enableSharing", func() {r := httptest.NewRequest("GET", "/index.html", nil)w := httptest.NewRecorder()serveIndex(ds, fs, nil)(w, r)config := extractAppConfig(w.Body.String())- Expect(config).To(HaveKeyWithValue("devEnableShare", false))+ Expect(config).To(HaveKeyWithValue("enableSharing", false))})It("sets the defaultDownsamplingFormat", func() {diff --git a/server/subsonic/api.go b/server/subsonic/api.goindex 6e3429a3e..400ec260e 100644--- a/server/subsonic/api.go+++ b/server/subsonic/api.go@@ -163,7 +163,7 @@ func (api *Router) routes() http.Handler {h(r, "getInternetRadioStations", api.GetInternetRadios)h(r, "updateInternetRadioStation", api.UpdateInternetRadio)})- if conf.Server.DevEnableShare {+ if conf.Server.EnableSharing {r.Group(func(r chi.Router) {h(r, "getShares", api.GetShares)h(r, "createShare", api.CreateShare)diff --git a/server/subsonic/users.go b/server/subsonic/users.goindex eeda13def..8018fd439 100644--- a/server/subsonic/users.go+++ b/server/subsonic/users.go@@ -22,7 +22,7 @@ func (api *Router) GetUser(r *http.Request) (*responses.Subsonic, error) {response.User.StreamRole = trueresponse.User.ScrobblingEnabled = trueresponse.User.DownloadRole = conf.Server.EnableDownloads- response.User.ShareRole = conf.Server.DevEnableShare+ response.User.ShareRole = conf.Server.EnableSharingreturn response, nil}@@ -38,7 +38,7 @@ func (api *Router) GetUsers(r *http.Request) (*responses.Subsonic, error) {user.StreamRole = trueuser.ScrobblingEnabled = trueuser.DownloadRole = conf.Server.EnableDownloads- user.ShareRole = conf.Server.DevEnableShare+ user.ShareRole = conf.Server.EnableSharingresponse := newResponse()response.Users = &responses.Users{User: []responses.User{user}}return response, nildiff --git a/ui/src/App.js b/ui/src/App.jsindex 33e72bf6b..6a876afe8 100644--- a/ui/src/App.js+++ b/ui/src/App.js@@ -110,7 +110,7 @@ const Admin = (props) => {name="radio"{...(permissions === 'admin' ? radio.admin : radio.all)}/>,- config.devEnableShare && <Resource name="share" {...share} />,+ config.enableSharing && <Resource name="share" {...share} />,<Resourcename="playlist"{...playlist}@@ -142,7 +142,7 @@ const Admin = (props) => {}const AppWithHotkeys = () => {- if (config.devEnableShare && shareInfo) {+ if (config.enableSharing && shareInfo) {return <SharePlayer />}return (diff --git a/ui/src/album/AlbumActions.js b/ui/src/album/AlbumActions.jsindex 6084a6232..c7f20f7ce 100644--- a/ui/src/album/AlbumActions.js+++ b/ui/src/album/AlbumActions.js@@ -108,7 +108,7 @@ const AlbumActions = ({><PlaylistAddIcon /></Button>- {config.devEnableShare && (+ {config.enableSharing && (<Button onClick={handleShare} label={translate('ra.action.share')}><ShareIcon /></Button>diff --git a/ui/src/common/ContextMenus.js b/ui/src/common/ContextMenus.jsindex 14f952389..ac22d860a 100644--- a/ui/src/common/ContextMenus.js+++ b/ui/src/common/ContextMenus.js@@ -81,7 +81,7 @@ const ContextMenu = ({action: (data, ids) => dispatch(openAddToPlaylist({ selectedIds: ids })),},share: {- enabled: config.devEnableShare,+ enabled: config.enableSharing,needData: false,label: translate('ra.action.share'),action: (record) => {diff --git a/ui/src/common/SongBulkActions.js b/ui/src/common/SongBulkActions.jsindex 8218139bd..9210bb020 100644--- a/ui/src/common/SongBulkActions.js+++ b/ui/src/common/SongBulkActions.js@@ -44,7 +44,7 @@ export const SongBulkActions = (props) => {icon={<RiPlayListAddFill />}className={classes.button}/>- {config.devEnableShare && (+ {config.enableSharing && (<BatchShareButton {...props} className={classes.button} />)}<AddToPlaylistButton {...props} className={classes.button} />diff --git a/ui/src/common/SongContextMenu.js b/ui/src/common/SongContextMenu.jsindex ef5d3e0f6..c49611be2 100644--- a/ui/src/common/SongContextMenu.js+++ b/ui/src/common/SongContextMenu.js@@ -65,7 +65,7 @@ export const SongContextMenu = ({),},share: {- enabled: config.devEnableShare,+ enabled: config.enableSharing,label: translate('ra.action.share'),action: (record) => {dispatch(openShareMenu([record.id], 'song', record.title))diff --git a/ui/src/config.js b/ui/src/config.jsindex 8b9a65e6c..da24ba3fc 100644--- a/ui/src/config.js+++ b/ui/src/config.js@@ -20,7 +20,7 @@ const defaultConfig = {defaultLanguage: '',defaultUIVolume: 100,enableUserEditing: true,- devEnableShare: true,+ enableSharing: true,devSidebarPlaylists: true,lastFMEnabled: true,lastFMApiKey: '9b94a5515ea66b2da3ec03c12300327e',diff --git a/ui/src/playlist/PlaylistActions.js b/ui/src/playlist/PlaylistActions.jsindex 8bf3bcdce..d98596c3b 100644--- a/ui/src/playlist/PlaylistActions.js+++ b/ui/src/playlist/PlaylistActions.js@@ -139,7 +139,7 @@ const PlaylistActions = ({ className, ids, data, record, ...rest }) => {><RiPlayListAddFill /></Button>- {config.devEnableShare && (+ {config.enableSharing && (<Button onClick={handleShare} label={translate('ra.action.share')}><ShareIcon /></Button>