diff --git a/ui/src/common/ContextMenus.js b/ui/src/common/ContextMenus.js index ac22d860a..131a697c7 100644 --- a/ui/src/common/ContextMenus.js +++ b/ui/src/common/ContextMenus.js @@ -84,9 +84,8 @@ const ContextMenu = ({ enabled: config.enableSharing, needData: false, label: translate('ra.action.share'), - action: (record) => { - dispatch(openShareMenu([record.id], resource, record.name)) - }, + action: (record) => + dispatch(openShareMenu([record.id], resource, record.name)), }, download: { enabled: config.enableDownloads && record.size, diff --git a/ui/src/common/SongContextMenu.js b/ui/src/common/SongContextMenu.js index c49611be2..3b8f60835 100644 --- a/ui/src/common/SongContextMenu.js +++ b/ui/src/common/SongContextMenu.js @@ -67,16 +67,16 @@ export const SongContextMenu = ({ share: { enabled: config.enableSharing, label: translate('ra.action.share'), - action: (record) => { - dispatch(openShareMenu([record.id], 'song', record.title)) - }, + action: (record) => + dispatch( + openShareMenu([record.mediaFileId || record.id], 'song', record.title) + ), }, download: { enabled: config.enableDownloads, label: `${translate('ra.action.download')} (${formatBytes(record.size)})`, - action: (record) => { - dispatch(openDownloadMenu(record, DOWNLOAD_MENU_SONG)) - }, + action: (record) => + dispatch(openDownloadMenu(record, DOWNLOAD_MENU_SONG)), }, info: { enabled: true, diff --git a/ui/src/dialogs/DownloadMenuDialog.js b/ui/src/dialogs/DownloadMenuDialog.js index 335279ad5..f97a4dec0 100644 --- a/ui/src/dialogs/DownloadMenuDialog.js +++ b/ui/src/dialogs/DownloadMenuDialog.js @@ -29,10 +29,11 @@ const DownloadMenuDialog = () => { const handleDownload = (e) => { if (record) { + const id = record.mediaFileId || record.id if (originalFormat) { - subsonic.download(record.id, 'raw') + subsonic.download(id, 'raw') } else { - subsonic.download(record.id, format, maxBitRate?.toString()) + subsonic.download(id, format, maxBitRate?.toString()) } dispatch(closeDownloadMenu()) }