Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing policy check for download all #5581

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 24 additions & 21 deletions src/components/itemContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down
Loading