Disable share downloading when EnableDownloads is false.

Fixes https://github.com/navidrome/navidrome/pull/2246#issuecomment-1472341635
This commit is contained in:
Deluan
2023-03-16 13:11:26 -04:00
parent 23c483da10
commit 377e7ebd52
5 changed files with 19 additions and 14 deletions
+2 -1
View File
@@ -9,6 +9,7 @@ import {
import { shareUrl } from '../utils'
import { Link } from '@material-ui/core'
import { DateField } from '../common'
import config from '../config'
export const ShareEdit = (props) => {
const { id, basePath, hasCreate, ...rest } = props
@@ -20,7 +21,7 @@ export const ShareEdit = (props) => {
{url}
</Link>
<TextInput source="description" />
<BooleanInput source="downloadable" />
{config.enableDownloads && <BooleanInput source="downloadable" />}
<DateTimeInput source="expiresAt" />
<TextInput source="contents" disabled />
<TextInput source="format" disabled />
+1 -1
View File
@@ -105,7 +105,7 @@ const ShareList = (props) => {
<TextField source="description" />
{isDesktop && <TextField source="contents" />}
{isDesktop && <FormatInfo source="format" />}
<BooleanField source="downloadable" />
{config.enableDownloads && <BooleanField source="downloadable" />}
<NumberField source="visitCount" />
{isDesktop && (
<DateField source="lastVisitedAt" showTime sortByOrder={'DESC'} />
+2 -2
View File
@@ -1,5 +1,5 @@
import ReactJkMusicPlayer from 'navidrome-music-player'
import { shareInfo } from '../config'
import config, { shareInfo } from '../config'
import { shareCoverUrl, shareDownloadUrl, shareStreamUrl } from '../utils'
import { makeStyles } from '@material-ui/core/styles'
@@ -44,7 +44,7 @@ const SharePlayer = () => {
mode: 'full',
toggleMode: false,
mobileMediaQuery: '',
showDownload: shareInfo?.downloadable,
showDownload: shareInfo?.downloadable && config.enableDownloads,
showReload: false,
showMediaSession: true,
theme: 'auto',