diff --git a/src/components/Settings/SettingsAbout/index.tsx b/src/components/Settings/SettingsAbout/index.tsx index ab79b11cd..1afe948dc 100644 --- a/src/components/Settings/SettingsAbout/index.tsx +++ b/src/components/Settings/SettingsAbout/index.tsx @@ -188,35 +188,6 @@ const SettingsAbout: React.FC = () => { -
- - - - https://github.com/sponsors/sct - - - {intl.formatMessage(messages.preferredmethod)} - - - - - https://patreon.com/overseerr - - - -
diff --git a/src/components/Settings/SettingsJobsCache/index.tsx b/src/components/Settings/SettingsJobsCache/index.tsx index 35e445cba..cfe8c4bfc 100644 --- a/src/components/Settings/SettingsJobsCache/index.tsx +++ b/src/components/Settings/SettingsJobsCache/index.tsx @@ -10,9 +10,11 @@ import { } from 'react-intl'; import { useToasts } from 'react-toast-notifications'; import useSWR from 'swr'; +import { MediaServerType } from '../../../../server/constants/server'; import { CacheItem } from '../../../../server/interfaces/api/settingsInterfaces'; import { JobId } from '../../../../server/lib/settings'; import Spinner from '../../../assets/spinner.svg'; +import useSettings from '../../../hooks/useSettings'; import globalMessages from '../../../i18n/globalMessages'; import { formatBytes } from '../../../utils/numberHelpers'; import Badge from '../../Common/Badge'; @@ -102,6 +104,7 @@ const SettingsJobs: React.FC = () => { const [isSaving, setIsSaving] = useState(false); const [jobScheduleMinutes, setJobScheduleMinutes] = useState(5); const [jobScheduleHours, setJobScheduleHours] = useState(1); + const settings = useSettings(); if (!data && !error) { return ; @@ -369,22 +372,33 @@ const SettingsJobs: React.FC = () => { - {cacheData?.map((cache) => ( - - {cache.name} - {intl.formatNumber(cache.stats.hits)} - {intl.formatNumber(cache.stats.misses)} - {intl.formatNumber(cache.stats.keys)} - {formatBytes(cache.stats.ksize)} - {formatBytes(cache.stats.vsize)} - - - - - ))} + {cacheData + ?.filter( + (cache) => + !( + settings.currentSettings.mediaServerType !== + MediaServerType.PLEX && cache.id === 'plexguid' + ) + ) + .map((cache) => ( + + {cache.name} + {intl.formatNumber(cache.stats.hits)} + {intl.formatNumber(cache.stats.misses)} + {intl.formatNumber(cache.stats.keys)} + {formatBytes(cache.stats.ksize)} + {formatBytes(cache.stats.vsize)} + + + + + ))} diff --git a/src/components/Settings/SettingsLayout.tsx b/src/components/Settings/SettingsLayout.tsx index 3963d5c5e..3de72f4a7 100644 --- a/src/components/Settings/SettingsLayout.tsx +++ b/src/components/Settings/SettingsLayout.tsx @@ -1,9 +1,11 @@ +import getConfig from 'next/config'; import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; +import { MediaServerType } from '../../../server/constants/server'; +import useSettings from '../../hooks/useSettings'; import globalMessages from '../../i18n/globalMessages'; import PageTitle from '../Common/PageTitle'; import SettingsTabs, { SettingsRoute } from '../Common/SettingsTabs'; -import getConfig from 'next/config'; const messages = defineMessages({ menuGeneralSettings: 'General', @@ -20,6 +22,7 @@ const messages = defineMessages({ const SettingsLayout: React.FC = ({ children }) => { const intl = useIntl(); const { publicRuntimeConfig } = getConfig(); + const settings = useSettings(); const settingsRoutes: SettingsRoute[] = [ { text: intl.formatMessage(messages.menuGeneralSettings), @@ -31,16 +34,17 @@ const SettingsLayout: React.FC = ({ children }) => { route: '/settings/users', regex: /^\/settings\/users/, }, - { - text: intl.formatMessage(messages.menuPlexSettings), - route: '/settings/plex', - regex: /^\/settings\/plex/, - }, - { - text: getAvalaibleMediaServerName(), - route: '/settings/jellyfin', - regex: /^\/settings\/jellyfin/, - }, + settings.currentSettings.mediaServerType === MediaServerType.PLEX + ? { + text: intl.formatMessage(messages.menuPlexSettings), + route: '/settings/plex', + regex: /^\/settings\/plex/, + } + : { + text: getAvailableMediaServerName(), + route: '/settings/jellyfin', + regex: /^\/settings\/jellyfin/, + }, { text: intl.formatMessage(messages.menuServices), route: '/settings/services', @@ -77,15 +81,10 @@ const SettingsLayout: React.FC = ({ children }) => {
{children}
); - function getAvalaibleMediaServerName() { - if (publicRuntimeConfig.JELLYFIN_TYPE === 'emby') { - return intl.formatMessage(messages.menuJellyfinSettings, { - mediaServerName: 'Emby', - }); - } - + function getAvailableMediaServerName() { return intl.formatMessage(messages.menuJellyfinSettings, { - mediaServerName: 'Jellyfin', + mediaServerName: + publicRuntimeConfig.JELLYFIN_TYPE === 'emby' ? 'Emby' : 'Jellyfin', }); } };