Skip to content

Commit 47889a5

Browse files
committed
Only download supported items
1 parent 6c03684 commit 47889a5

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

src/components/itemContextMenu.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -426,17 +426,19 @@ function executeCommand(item, id, options) {
426426
case 'downloadall': {
427427
const downloadItems = items => {
428428
import('../scripts/fileDownloader').then((fileDownloader) => {
429-
const downloads = items.map(item => {
430-
const downloadHref = apiClient.getItemDownloadUrl(item.Id);
431-
return {
432-
url: downloadHref,
433-
item,
434-
itemId: item.Id,
435-
serverId,
436-
title: item.Name,
437-
filename: item.Path.replace(/^.*[\\/]/, '')
438-
};
439-
});
429+
const downloads = items
430+
.filter(i => i.CanDownload)
431+
.map(i => {
432+
const downloadHref = apiClient.getItemDownloadUrl(i.Id);
433+
return {
434+
url: downloadHref,
435+
item: i,
436+
itemId: i.Id,
437+
serverId,
438+
title: i.Name,
439+
filename: i.Path.replace(/^.*[\\/]/, '')
440+
};
441+
});
440442

441443
fileDownloader.download(downloads);
442444
});

0 commit comments

Comments
 (0)