From d6130751e8367836ca8d7282ffc6c1a9656ea9f6 Mon Sep 17 00:00:00 2001 From: thornbill Date: Sat, 25 May 2024 11:50:44 -0400 Subject: [PATCH] Backport pull request #5581 from jellyfin-web/release-10.9.z Fix missing policy check for download all Original-merge: bb9b4ce8bbaa6033307d580db7dc03ddaabe66ce Merged-by: thornbill Backported-by: Joshua M. Boniface --- src/components/itemContextMenu.js | 45 ++++++++++++++++--------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/components/itemContextMenu.js b/src/components/itemContextMenu.js index 263a557164..fe0f063682 100644 --- a/src/components/itemContextMenu.js +++ b/src/components/itemContextMenu.js @@ -169,12 +169,30 @@ export function getCommands(options) { }); } - if (item.Type === 'Season' || item.Type == 'Series') { - commands.push({ - name: globalize.translate('DownloadAll'), - id: 'downloadall', - icon: 'file_download' - }); + if (appHost.supports('filedownload')) { + // CanDownload should probably be updated to return true for these items? + if (user.Policy.EnableContentDownloading && (item.Type === 'Season' || item.Type == 'Series')) { + commands.push({ + name: globalize.translate('DownloadAll'), + id: 'downloadall', + icon: 'file_download' + }); + } + + // Books are promoted to major download Button and therefor excluded in the context menu + if (item.CanDownload && item.Type !== 'Book') { + commands.push({ + name: globalize.translate('Download'), + id: 'download', + icon: 'file_download' + }); + + commands.push({ + name: globalize.translate('CopyStreamURL'), + id: 'copy-stream', + icon: 'content_copy' + }); + } } if (item.CanDelete && options.deleteItem !== false) { @@ -193,21 +211,6 @@ export function getCommands(options) { } } - // Books are promoted to major download Button and therefor excluded in the context menu - if ((item.CanDownload && appHost.supports('filedownload')) && item.Type !== 'Book') { - commands.push({ - name: globalize.translate('Download'), - id: 'download', - icon: 'file_download' - }); - - commands.push({ - name: globalize.translate('CopyStreamURL'), - id: 'copy-stream', - icon: 'content_copy' - }); - } - if (commands.length) { commands.push({ divider: true