Disable creation of shares when feature is disabled.

Fix https://github.com/navidrome/navidrome/pull/2106#issuecomment-1404731388
This commit is contained in:
Deluan 2023-01-26 10:12:13 -05:00
parent b825d3cfac
commit e2ea5eba8c
2 changed files with 7 additions and 2 deletions

View File

@ -45,7 +45,9 @@ 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)
n.RX(r, "/share", n.share.NewRepository, true)
if conf.Server.DevEnableShare {
n.RX(r, "/share", n.share.NewRepository, true)
}
n.addPlaylistTrackRoute(r)

View File

@ -7,6 +7,7 @@ import { BatchPlayButton } from './index'
import { AddToPlaylistButton } from './AddToPlaylistButton'
import { makeStyles } from '@material-ui/core/styles'
import { BatchShareButton } from './BatchShareButton'
import config from '../config'
const useStyles = makeStyles((theme) => ({
button: {
@ -43,7 +44,9 @@ export const SongBulkActions = (props) => {
icon={<RiPlayListAddFill />}
className={classes.button}
/>
<BatchShareButton {...props} className={classes.button} />
{config.devEnableShare && (
<BatchShareButton {...props} className={classes.button} />
)}
<AddToPlaylistButton {...props} className={classes.button} />
</Fragment>
)