diff --git a/src/components/itemContextMenu.js b/src/components/itemContextMenu.js index 6d1c3c24f5..374b5b98b1 100644 --- a/src/components/itemContextMenu.js +++ b/src/components/itemContextMenu.js @@ -11,6 +11,20 @@ import ServerConnections from './ServerConnections'; import toast from './toast/toast'; import * as userSettings from '../scripts/settings/userSettings'; +function getDeleteCommandName(type) { + switch (type) { + case 'Series': + return globalize.translate('DeleteSeries'); + + case 'Playlist': + case 'BoxSet': + return globalize.translate('Delete'); + + default: + return globalize.translate('DeleteMedia'); + } +} + export function getCommands(options) { const item = options.item; const user = options.user; @@ -160,19 +174,11 @@ export function getCommands(options) { } if (item.CanDelete && options.deleteItem !== false) { - if (item.Type === 'Playlist' || item.Type === 'BoxSet') { - commands.push({ - name: globalize.translate('Delete'), - id: 'delete', - icon: 'delete' - }); - } else { - commands.push({ - name: globalize.translate('DeleteMedia'), - id: 'delete', - icon: 'delete' - }); - } + commands.push({ + name: getDeleteCommandName(item.Type), + id: 'delete', + icon: 'delete' + }); } // Books are promoted to major download Button and therefor excluded in the context menu diff --git a/src/scripts/deleteHelper.js b/src/scripts/deleteHelper.js index ca46407db7..90bf30e1b6 100644 --- a/src/scripts/deleteHelper.js +++ b/src/scripts/deleteHelper.js @@ -9,17 +9,37 @@ function alertText(options) { return alert(options); } +function getDeleteText(item) { + if (item.Type === 'Series') { + const totalEpisodes = item.RecursiveItemCount; + + return { + title: globalize.translate('HeaderDeleteSeries'), + text: globalize.translate('ConfirmDeleteSeries', totalEpisodes), + confirmText: globalize.translate('DeleteEntireSeries', totalEpisodes) + }; + } + + return { + title: globalize.translate('HeaderDeleteItem'), + text: globalize.translate('ConfirmDeleteItem'), + confirmText: globalize.translate('Delete') + + }; +} + export function deleteItem(options) { const item = options.item; const parentId = item.SeasonId || item.SeriesId || item.ParentId; + const { confirmText, text, title } = getDeleteText(item); const apiClient = ServerConnections.getApiClient(item.ServerId); return confirm({ - title: globalize.translate('HeaderDeleteItem'), - text: globalize.translate('ConfirmDeleteItem'), - confirmText: globalize.translate('Delete'), + title, + text, + confirmText, primary: 'delete' }).then(function () { diff --git a/src/strings/en-us.json b/src/strings/en-us.json index c7a6fe5edf..8125a12c0e 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -151,6 +151,7 @@ "ConfigureDateAdded": "Set up how metadata for 'Date added' is determined in the Dashboard > Libraries > NFO Settings", "ConfirmDeleteImage": "Delete image?", "ConfirmDeleteItem": "Deleting this item will delete it from both the file system and your media library. Are you sure you wish to continue?", + "ConfirmDeleteSeries": "Deleting this series will delete ALL {0} episodes from both the file system and your media library. Are you sure you wish to continue?", "ConfirmDeleteItems": "Deleting these items will delete them from both the file system and your media library. Are you sure you wish to continue?", "ConfirmDeletion": "Confirm Deletion", "ConfirmEndPlayerSession": "Would you like to shutdown Jellyfin on {0}?", @@ -176,12 +177,14 @@ "DefaultSubtitlesHelp": "Subtitles are loaded based on the default and forced flags in the embedded metadata. Language preferences are considered when multiple options are available.", "DeinterlaceMethodHelp": "Select the deinterlacing method to use when software transcoding interlaced content. When hardware acceleration supporting hardware deinterlacing is enabled the hardware deinterlacer will be used instead of this setting.", "Delete": "Delete", + "DeleteEntireSeries": "Delete {0} Episodes", "DeleteAll": "Delete All", "DeleteDeviceConfirmation": "Are you sure you wish to delete this device? It will reappear the next time a user signs in with it.", "DeleteDevicesConfirmation": "Are you sure you wish to delete all devices? All other sessions will be logged out. Devices will reappear the next time a user signs in.", "DeleteImage": "Delete Image", "DeleteImageConfirmation": "Are you sure you wish to delete this image?", "DeleteMedia": "Delete media", + "DeleteSeries": "Delete Series", "DeleteUser": "Delete User", "DeleteUserConfirmation": "Are you sure you wish to delete this user?", "Depressed": "Depressed", @@ -358,6 +361,7 @@ "HeaderDeleteDevice": "Delete Device", "HeaderDeleteDevices": "Delete All Devices", "HeaderDeleteItem": "Delete Item", + "HeaderDeleteSeries": "Delete Series", "HeaderDeleteItems": "Delete Items", "HeaderDeleteProvider": "Delete Provider", "HeaderDeleteTaskTrigger": "Delete Task Trigger", diff --git a/src/strings/he.json b/src/strings/he.json index cc7313d22c..f9676ba22c 100644 --- a/src/strings/he.json +++ b/src/strings/he.json @@ -36,15 +36,18 @@ "ConfigureDateAdded": "‫הגדר כיצד תאריך ההוספה נקבע בלוח המחוונים ב- Dashboard > Libraries > NFO Settings", "ConfirmDeleteImage": "למחוק את התמונה?", "ConfirmDeleteItem": "מחיקת פריט זה תמחק אותו הן ממערכת הקבצים והן מספריית המדיה שלך. האם אתה בטוח שברצונך להמשיך?", + "ConfirmDeleteSeries": "מחיקת סדרה זו תמחק את כל {0} הפרקים הן ממערכת הקבצים והן מספריית המדיה שלך. האם אתה בטוח שברצונך להמשיך?", "ConfirmDeleteItems": "מחיקת פריטים אלה תמחק אותם הן ממערכת הקבצים והן מספריית המדיה שלך. האם אתה בטוח שברצונך להמשיך?", "ConfirmDeletion": "אשר מחיקה", "Continuing": "ממשיך", "CustomDlnaProfilesHelp": "צור פרופיל מותאם אישית למכשיר חדש או לעקיפת פרופיל מערכת.", "ErrorDefault": "אירעה שגיאה בעיבוד הבקשה. בבקשה נסה שוב מאוחר יותר.", "Delete": "מחק", + "DeleteEntireSeries": "מחק {0} פרקים", "DeleteImage": "מחק תמונה", "DeleteImageConfirmation": "האם אתה בטוח שברצונך למחוק תמונה זו?", "DeleteMedia": "מחק מדיה", + "DeleteSeries": "מחק סדרה", "DeleteUser": "מחק משתמש", "DoNotRecord": "אל תקליט", "Download": "הורדה", @@ -74,6 +77,7 @@ "HeaderConfirmPluginInstallation": "אשר התקנת תוסף", "HeaderCustomDlnaProfiles": "פרופילים מותאמים אישית", "HeaderDeleteItem": "מחק פריט", + "HeaderDeleteSeries": "מחק סדרה", "HeaderDeleteItems": "מחיקת פריטים", "HeaderEasyPinCode": "קוד אישי קל", "HeaderEditImages": "ערוך תמונות",