Fix downloading and sharing from a playlist. Fix #2123

This commit is contained in:
Deluan 2023-01-30 11:20:22 -05:00
parent 25374b3bbe
commit 762a1ba998
3 changed files with 11 additions and 11 deletions

View file

@ -84,9 +84,8 @@ const ContextMenu = ({
enabled: config.enableSharing, enabled: config.enableSharing,
needData: false, needData: false,
label: translate('ra.action.share'), label: translate('ra.action.share'),
action: (record) => { action: (record) =>
dispatch(openShareMenu([record.id], resource, record.name)) dispatch(openShareMenu([record.id], resource, record.name)),
},
}, },
download: { download: {
enabled: config.enableDownloads && record.size, enabled: config.enableDownloads && record.size,

View file

@ -67,16 +67,16 @@ export const SongContextMenu = ({
share: { share: {
enabled: config.enableSharing, 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.mediaFileId || record.id], 'song', record.title)
),
}, },
download: { download: {
enabled: config.enableDownloads, enabled: config.enableDownloads,
label: `${translate('ra.action.download')} (${formatBytes(record.size)})`, label: `${translate('ra.action.download')} (${formatBytes(record.size)})`,
action: (record) => { action: (record) =>
dispatch(openDownloadMenu(record, DOWNLOAD_MENU_SONG)) dispatch(openDownloadMenu(record, DOWNLOAD_MENU_SONG)),
},
}, },
info: { info: {
enabled: true, enabled: true,

View file

@ -29,10 +29,11 @@ const DownloadMenuDialog = () => {
const handleDownload = (e) => { const handleDownload = (e) => {
if (record) { if (record) {
const id = record.mediaFileId || record.id
if (originalFormat) { if (originalFormat) {
subsonic.download(record.id, 'raw') subsonic.download(id, 'raw')
} else { } else {
subsonic.download(record.id, format, maxBitRate?.toString()) subsonic.download(id, format, maxBitRate?.toString())
} }
dispatch(closeDownloadMenu()) dispatch(closeDownloadMenu())
} }