Rename `DevEnableShare` to `EnableSharing`
This commit is contained in:
parent
a651d65a5b
commit
68e6115789
|
@ -52,6 +52,7 @@ type configOptions struct {
|
||||||
EnableFavourites bool
|
EnableFavourites bool
|
||||||
EnableStarRating bool
|
EnableStarRating bool
|
||||||
EnableUserEditing bool
|
EnableUserEditing bool
|
||||||
|
EnableSharing bool
|
||||||
DefaultTheme string
|
DefaultTheme string
|
||||||
DefaultLanguage string
|
DefaultLanguage string
|
||||||
DefaultUIVolume int
|
DefaultUIVolume int
|
||||||
|
@ -78,7 +79,6 @@ type configOptions struct {
|
||||||
DevAutoCreateAdminPassword string
|
DevAutoCreateAdminPassword string
|
||||||
DevAutoLoginUsername string
|
DevAutoLoginUsername string
|
||||||
DevActivityPanel bool
|
DevActivityPanel bool
|
||||||
DevEnableShare bool
|
|
||||||
DevSidebarPlaylists bool
|
DevSidebarPlaylists bool
|
||||||
DevEnableBufferedScrobble bool
|
DevEnableBufferedScrobble bool
|
||||||
DevShowArtistPage bool
|
DevShowArtistPage bool
|
||||||
|
@ -282,7 +282,7 @@ func init() {
|
||||||
viper.SetDefault("devautocreateadminpassword", "")
|
viper.SetDefault("devautocreateadminpassword", "")
|
||||||
viper.SetDefault("devautologinusername", "")
|
viper.SetDefault("devautologinusername", "")
|
||||||
viper.SetDefault("devactivitypanel", true)
|
viper.SetDefault("devactivitypanel", true)
|
||||||
viper.SetDefault("devenableshare", false)
|
viper.SetDefault("enablesharing", false)
|
||||||
viper.SetDefault("devenablebufferedscrobble", true)
|
viper.SetDefault("devenablebufferedscrobble", true)
|
||||||
viper.SetDefault("devsidebarplaylists", true)
|
viper.SetDefault("devsidebarplaylists", true)
|
||||||
viper.SetDefault("devshowartistpage", true)
|
viper.SetDefault("devshowartistpage", true)
|
||||||
|
|
|
@ -45,7 +45,7 @@ func (n *Router) routes() http.Handler {
|
||||||
n.R(r, "/playlist", model.Playlist{}, true)
|
n.R(r, "/playlist", model.Playlist{}, true)
|
||||||
n.R(r, "/transcoding", model.Transcoding{}, conf.Server.EnableTranscodingConfig)
|
n.R(r, "/transcoding", model.Transcoding{}, conf.Server.EnableTranscodingConfig)
|
||||||
n.R(r, "/radio", model.Radio{}, true)
|
n.R(r, "/radio", model.Radio{}, true)
|
||||||
if conf.Server.DevEnableShare {
|
if conf.Server.EnableSharing {
|
||||||
n.RX(r, "/share", n.share.NewRepository, true)
|
n.RX(r, "/share", n.share.NewRepository, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ func (p *Router) routes() http.Handler {
|
||||||
r.Group(func(r chi.Router) {
|
r.Group(func(r chi.Router) {
|
||||||
r.Use(server.URLParamsMiddleware)
|
r.Use(server.URLParamsMiddleware)
|
||||||
r.HandleFunc("/img/{id}", p.handleImages)
|
r.HandleFunc("/img/{id}", p.handleImages)
|
||||||
if conf.Server.DevEnableShare {
|
if conf.Server.EnableSharing {
|
||||||
r.HandleFunc("/s/{id}", p.handleStream)
|
r.HandleFunc("/s/{id}", p.handleStream)
|
||||||
r.HandleFunc("/{id}", p.handleShares)
|
r.HandleFunc("/{id}", p.handleShares)
|
||||||
r.HandleFunc("/", p.handleShares)
|
r.HandleFunc("/", p.handleShares)
|
||||||
|
|
|
@ -56,7 +56,7 @@ func serveIndex(ds model.DataStore, fs fs.FS, shareInfo *model.Share) http.Handl
|
||||||
"losslessFormats": strings.ToUpper(strings.Join(consts.LosslessFormats, ",")),
|
"losslessFormats": strings.ToUpper(strings.Join(consts.LosslessFormats, ",")),
|
||||||
"devActivityPanel": conf.Server.DevActivityPanel,
|
"devActivityPanel": conf.Server.DevActivityPanel,
|
||||||
"enableUserEditing": conf.Server.EnableUserEditing,
|
"enableUserEditing": conf.Server.EnableUserEditing,
|
||||||
"devEnableShare": conf.Server.DevEnableShare,
|
"enableSharing": conf.Server.EnableSharing,
|
||||||
"devSidebarPlaylists": conf.Server.DevSidebarPlaylists,
|
"devSidebarPlaylists": conf.Server.DevSidebarPlaylists,
|
||||||
"lastFMEnabled": conf.Server.LastFM.Enabled,
|
"lastFMEnabled": conf.Server.LastFM.Enabled,
|
||||||
"lastFMApiKey": conf.Server.LastFM.ApiKey,
|
"lastFMApiKey": conf.Server.LastFM.ApiKey,
|
||||||
|
|
|
@ -224,14 +224,14 @@ var _ = Describe("serveIndex", func() {
|
||||||
Expect(config).To(HaveKeyWithValue("enableUserEditing", true))
|
Expect(config).To(HaveKeyWithValue("enableUserEditing", true))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("sets the devEnableShare", func() {
|
It("sets the enableSharing", func() {
|
||||||
r := httptest.NewRequest("GET", "/index.html", nil)
|
r := httptest.NewRequest("GET", "/index.html", nil)
|
||||||
w := httptest.NewRecorder()
|
w := httptest.NewRecorder()
|
||||||
|
|
||||||
serveIndex(ds, fs, nil)(w, r)
|
serveIndex(ds, fs, nil)(w, r)
|
||||||
|
|
||||||
config := extractAppConfig(w.Body.String())
|
config := extractAppConfig(w.Body.String())
|
||||||
Expect(config).To(HaveKeyWithValue("devEnableShare", false))
|
Expect(config).To(HaveKeyWithValue("enableSharing", false))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("sets the defaultDownsamplingFormat", func() {
|
It("sets the defaultDownsamplingFormat", func() {
|
||||||
|
|
|
@ -163,7 +163,7 @@ func (api *Router) routes() http.Handler {
|
||||||
h(r, "getInternetRadioStations", api.GetInternetRadios)
|
h(r, "getInternetRadioStations", api.GetInternetRadios)
|
||||||
h(r, "updateInternetRadioStation", api.UpdateInternetRadio)
|
h(r, "updateInternetRadioStation", api.UpdateInternetRadio)
|
||||||
})
|
})
|
||||||
if conf.Server.DevEnableShare {
|
if conf.Server.EnableSharing {
|
||||||
r.Group(func(r chi.Router) {
|
r.Group(func(r chi.Router) {
|
||||||
h(r, "getShares", api.GetShares)
|
h(r, "getShares", api.GetShares)
|
||||||
h(r, "createShare", api.CreateShare)
|
h(r, "createShare", api.CreateShare)
|
||||||
|
|
|
@ -22,7 +22,7 @@ func (api *Router) GetUser(r *http.Request) (*responses.Subsonic, error) {
|
||||||
response.User.StreamRole = true
|
response.User.StreamRole = true
|
||||||
response.User.ScrobblingEnabled = true
|
response.User.ScrobblingEnabled = true
|
||||||
response.User.DownloadRole = conf.Server.EnableDownloads
|
response.User.DownloadRole = conf.Server.EnableDownloads
|
||||||
response.User.ShareRole = conf.Server.DevEnableShare
|
response.User.ShareRole = conf.Server.EnableSharing
|
||||||
return response, nil
|
return response, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ func (api *Router) GetUsers(r *http.Request) (*responses.Subsonic, error) {
|
||||||
user.StreamRole = true
|
user.StreamRole = true
|
||||||
user.ScrobblingEnabled = true
|
user.ScrobblingEnabled = true
|
||||||
user.DownloadRole = conf.Server.EnableDownloads
|
user.DownloadRole = conf.Server.EnableDownloads
|
||||||
user.ShareRole = conf.Server.DevEnableShare
|
user.ShareRole = conf.Server.EnableSharing
|
||||||
response := newResponse()
|
response := newResponse()
|
||||||
response.Users = &responses.Users{User: []responses.User{user}}
|
response.Users = &responses.Users{User: []responses.User{user}}
|
||||||
return response, nil
|
return response, nil
|
||||||
|
|
|
@ -110,7 +110,7 @@ const Admin = (props) => {
|
||||||
name="radio"
|
name="radio"
|
||||||
{...(permissions === 'admin' ? radio.admin : radio.all)}
|
{...(permissions === 'admin' ? radio.admin : radio.all)}
|
||||||
/>,
|
/>,
|
||||||
config.devEnableShare && <Resource name="share" {...share} />,
|
config.enableSharing && <Resource name="share" {...share} />,
|
||||||
<Resource
|
<Resource
|
||||||
name="playlist"
|
name="playlist"
|
||||||
{...playlist}
|
{...playlist}
|
||||||
|
@ -142,7 +142,7 @@ const Admin = (props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const AppWithHotkeys = () => {
|
const AppWithHotkeys = () => {
|
||||||
if (config.devEnableShare && shareInfo) {
|
if (config.enableSharing && shareInfo) {
|
||||||
return <SharePlayer />
|
return <SharePlayer />
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -108,7 +108,7 @@ const AlbumActions = ({
|
||||||
>
|
>
|
||||||
<PlaylistAddIcon />
|
<PlaylistAddIcon />
|
||||||
</Button>
|
</Button>
|
||||||
{config.devEnableShare && (
|
{config.enableSharing && (
|
||||||
<Button onClick={handleShare} label={translate('ra.action.share')}>
|
<Button onClick={handleShare} label={translate('ra.action.share')}>
|
||||||
<ShareIcon />
|
<ShareIcon />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -81,7 +81,7 @@ const ContextMenu = ({
|
||||||
action: (data, ids) => dispatch(openAddToPlaylist({ selectedIds: ids })),
|
action: (data, ids) => dispatch(openAddToPlaylist({ selectedIds: ids })),
|
||||||
},
|
},
|
||||||
share: {
|
share: {
|
||||||
enabled: config.devEnableShare,
|
enabled: config.enableSharing,
|
||||||
needData: false,
|
needData: false,
|
||||||
label: translate('ra.action.share'),
|
label: translate('ra.action.share'),
|
||||||
action: (record) => {
|
action: (record) => {
|
||||||
|
|
|
@ -44,7 +44,7 @@ export const SongBulkActions = (props) => {
|
||||||
icon={<RiPlayListAddFill />}
|
icon={<RiPlayListAddFill />}
|
||||||
className={classes.button}
|
className={classes.button}
|
||||||
/>
|
/>
|
||||||
{config.devEnableShare && (
|
{config.enableSharing && (
|
||||||
<BatchShareButton {...props} className={classes.button} />
|
<BatchShareButton {...props} className={classes.button} />
|
||||||
)}
|
)}
|
||||||
<AddToPlaylistButton {...props} className={classes.button} />
|
<AddToPlaylistButton {...props} className={classes.button} />
|
||||||
|
|
|
@ -65,7 +65,7 @@ export const SongContextMenu = ({
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
share: {
|
share: {
|
||||||
enabled: config.devEnableShare,
|
enabled: config.enableSharing,
|
||||||
label: translate('ra.action.share'),
|
label: translate('ra.action.share'),
|
||||||
action: (record) => {
|
action: (record) => {
|
||||||
dispatch(openShareMenu([record.id], 'song', record.title))
|
dispatch(openShareMenu([record.id], 'song', record.title))
|
||||||
|
|
|
@ -20,7 +20,7 @@ const defaultConfig = {
|
||||||
defaultLanguage: '',
|
defaultLanguage: '',
|
||||||
defaultUIVolume: 100,
|
defaultUIVolume: 100,
|
||||||
enableUserEditing: true,
|
enableUserEditing: true,
|
||||||
devEnableShare: true,
|
enableSharing: true,
|
||||||
devSidebarPlaylists: true,
|
devSidebarPlaylists: true,
|
||||||
lastFMEnabled: true,
|
lastFMEnabled: true,
|
||||||
lastFMApiKey: '9b94a5515ea66b2da3ec03c12300327e',
|
lastFMApiKey: '9b94a5515ea66b2da3ec03c12300327e',
|
||||||
|
|
|
@ -139,7 +139,7 @@ const PlaylistActions = ({ className, ids, data, record, ...rest }) => {
|
||||||
>
|
>
|
||||||
<RiPlayListAddFill />
|
<RiPlayListAddFill />
|
||||||
</Button>
|
</Button>
|
||||||
{config.devEnableShare && (
|
{config.enableSharing && (
|
||||||
<Button onClick={handleShare} label={translate('ra.action.share')}>
|
<Button onClick={handleShare} label={translate('ra.action.share')}>
|
||||||
<ShareIcon />
|
<ShareIcon />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
Loading…
Reference in New Issue