From 9eeec9270dd4d7e9f02d80872e5a1d98187e0850 Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Sat, 6 Jan 2024 19:34:34 +0100 Subject: [PATCH] Remove unused sync code --- src/components/apphost.js | 4 ---- src/components/itemContextMenu.js | 8 -------- src/components/itemHelper.js | 13 ------------- src/components/metadataEditor/metadataEditor.js | 1 - src/scripts/libraryMenu.js | 14 -------------- src/strings/en-us.json | 1 - 6 files changed, 41 deletions(-) diff --git a/src/components/apphost.js b/src/components/apphost.js index 2360a8f23..053b84637 100644 --- a/src/components/apphost.js +++ b/src/components/apphost.js @@ -230,10 +230,6 @@ const supportedFeatures = function () { features.push('htmlvideoautoplay'); } - if (browser.edgeUwp) { - features.push('sync'); - } - if (supportsFullscreen()) { features.push('fullscreenchange'); } diff --git a/src/components/itemContextMenu.js b/src/components/itemContextMenu.js index bf03b6903..69caf9cbc 100644 --- a/src/components/itemContextMenu.js +++ b/src/components/itemContextMenu.js @@ -290,14 +290,6 @@ export function getCommands(options) { }); } - if (options.sync !== false && itemHelper.canSync(user, item)) { - commands.push({ - name: globalize.translate('Sync'), - id: 'sync', - icon: 'sync' - }); - } - if (options.openAlbum !== false && item.AlbumId && item.MediaType !== 'Photo') { commands.push({ name: globalize.translate('ViewAlbum'), diff --git a/src/components/itemHelper.js b/src/components/itemHelper.js index ed5982051..fff0d7ed1 100644 --- a/src/components/itemHelper.js +++ b/src/components/itemHelper.js @@ -154,18 +154,6 @@ export function canEditImages (user, item) { return itemType !== 'Timer' && itemType !== 'SeriesTimer' && canEdit(user, item) && !isLocalItem(item); } -export function canSync (user, item) { - if (user && !user.Policy.EnableContentDownloading) { - return false; - } - - if (isLocalItem(item)) { - return false; - } - - return item.SupportsSync; -} - export function canShare (item, user) { if (item.Type === 'Program') { return false; @@ -311,7 +299,6 @@ export default { canIdentify: canIdentify, canEdit: canEdit, canEditImages: canEditImages, - canSync: canSync, canShare: canShare, enableDateAddedDisplay: enableDateAddedDisplay, canMarkPlayed: canMarkPlayed, diff --git a/src/components/metadataEditor/metadataEditor.js b/src/components/metadataEditor/metadataEditor.js index 9c15d316b..b1c9d721b 100644 --- a/src/components/metadataEditor/metadataEditor.js +++ b/src/components/metadataEditor/metadataEditor.js @@ -260,7 +260,6 @@ function showMoreMenu(context, button, user) { edit: false, editImages: true, editSubtitles: true, - sync: false, share: false, play: false, queue: false, diff --git a/src/scripts/libraryMenu.js b/src/scripts/libraryMenu.js index ce105dbec..405bef868 100644 --- a/src/scripts/libraryMenu.js +++ b/src/scripts/libraryMenu.js @@ -421,24 +421,10 @@ function showBySelector(selector, show) { function updateLibraryMenu(user) { if (!user) { - showBySelector('.libraryMenuDownloads', false); - showBySelector('.lnkSyncToOtherDevices', false); showBySelector('.userMenuOptions', false); return; } - if (user.Policy.EnableContentDownloading) { - showBySelector('.lnkSyncToOtherDevices', true); - } else { - showBySelector('.lnkSyncToOtherDevices', false); - } - - if (user.Policy.EnableContentDownloading && appHost.supports('sync')) { - showBySelector('.libraryMenuDownloads', true); - } else { - showBySelector('.libraryMenuDownloads', false); - } - const userId = Dashboard.getCurrentUserId(); const apiClient = getCurrentApiClient(); diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 17ca1ca39..ba5c8c033 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -1497,7 +1497,6 @@ "SubtitleYellow": "Yellow", "Suggestions": "Suggestions", "Sunday": "Sunday", - "Sync": "Sync", "SyncPlayAccessHelp": "The SyncPlay feature enables to sync playback with other devices. Select the level of access this user has to the SyncPlay.", "SyncPlayGroupDefaultTitle": "{0}'s group", "SystemDlnaProfilesHelp": "System profiles are read-only. Changes to a system profile will be saved to a new custom profile.",