Add config option to globally enable/disable downloads
This commit is contained in:
@@ -15,6 +15,7 @@ import { playNext, addTracks, playTracks, shuffleTracks } from '../actions'
|
||||
import subsonic from '../subsonic'
|
||||
import { formatBytes } from '../common/SizeField'
|
||||
import { useMediaQuery } from '@material-ui/core'
|
||||
import config from '../config'
|
||||
|
||||
const AlbumActions = ({ className, ids, data, record, ...rest }) => {
|
||||
const dispatch = useDispatch()
|
||||
@@ -67,15 +68,17 @@ const AlbumActions = ({ 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>
|
||||
)}
|
||||
</TopToolbar>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user