Add config option to globally enable/disable downloads

This commit is contained in:
Deluan
2020-11-10 16:14:43 -05:00
parent bf69c5589f
commit 08e63c867b
9 changed files with 76 additions and 28 deletions
+12 -9
View File
@@ -18,6 +18,7 @@ import subsonic from '../subsonic'
import PropTypes from 'prop-types'
import { formatBytes } from '../common/SizeField'
import { useMediaQuery } from '@material-ui/core'
import config from '../config'
const PlaylistActions = ({ className, ids, data, record, ...rest }) => {
const dispatch = useDispatch()
@@ -88,15 +89,17 @@ const PlaylistActions = ({ className, ids, data, record, ...rest }) => {
>
<RiPlayListAddFill />
</Button>
<Button
onClick={handleDownload}
label={
translate('resources.album.actions.download') +
(isDesktop ? ` (${formatBytes(record.size)})` : '')
}
>
<CloudDownloadOutlinedIcon />
</Button>
{config.enableDownloads && (
<Button
onClick={handleDownload}
label={
translate('resources.album.actions.download') +
(isDesktop ? ` (${formatBytes(record.size)})` : '')
}
>
<CloudDownloadOutlinedIcon />
</Button>
)}
<Button
onClick={handleExport}
label={translate('resources.playlist.actions.export')}