Skip to content

Commit

Permalink
Fix downloading and sharing from a playlist. Fix #2123
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Jan 30, 2023
1 parent 25374b3 commit 762a1ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
5 changes: 2 additions & 3 deletions ui/src/common/ContextMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions ui/src/common/SongContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions ui/src/dialogs/DownloadMenuDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down

0 comments on commit 762a1ba

Please sign in to comment.