From 3cb9494e6210151716587d8c4b22e0a21692cf88 Mon Sep 17 00:00:00 2001 From: fallenbagel <98979876+Fallenbagel@users.noreply.github.com> Date: Wed, 8 Nov 2023 00:19:44 +0500 Subject: [PATCH 1/3] fix(watchlist): discover local watchlist item display and profile local watchlist slider visibility Previously when you expand the `Your Watchlist` slider from the discover page to see all your watchlist items, you only see the first 20 items. This commit fixes that so you can see all your local watchlist items when you expand that slider. In addition, this commit also fixes the visiblity of profile watchlist slider for local watchlists --- server/routes/discover.ts | 3 +- server/routes/user/index.ts | 38 +++++++------- .../Discover/DiscoverWatchlist/index.tsx | 2 +- src/components/UserProfile/index.tsx | 41 ++++++++------- src/i18n/locale/en.json | 51 ++++++++++--------- 5 files changed, 72 insertions(+), 63 deletions(-) diff --git a/server/routes/discover.ts b/server/routes/discover.ts index b5fe22ea7..88d893cae 100644 --- a/server/routes/discover.ts +++ b/server/routes/discover.ts @@ -848,7 +848,7 @@ discoverRoutes.get, WatchlistResponse>( if (total) { return res.json({ page: page, - totalPages: total / itemsPerPage, + totalPages: Math.ceil(total / itemsPerPage), totalResults: total, results: result, }); @@ -865,7 +865,6 @@ discoverRoutes.get, WatchlistResponse>( } const plexTV = new PlexTvAPI(activeUser.plexToken); - const watchlist = await plexTV.getWatchlist({ offset }); return res.json({ diff --git a/server/routes/user/index.ts b/server/routes/user/index.ts index 046a1471d..9d9370cf2 100644 --- a/server/routes/user/index.ts +++ b/server/routes/user/index.ts @@ -717,29 +717,31 @@ router.get<{ id: string }, WatchlistResponse>( const user = await getRepository(User).findOneOrFail({ where: { id: Number(req.params.id) }, - select: { id: true, plexToken: true }, + select: ['id', 'plexToken'], }); - if (!user?.plexToken) { - if (user) { - const [result, total] = await getRepository(Watchlist).findAndCount({ - where: { requestedBy: { id: user?.id } }, - relations: { requestedBy: true }, - // loadRelationIds: true, - take: itemsPerPage, - skip: offset, + if (user) { + const [result, total] = await getRepository(Watchlist).findAndCount({ + where: { requestedBy: { id: user?.id } }, + relations: { + /*requestedBy: true,media:true*/ + }, + // loadRelationIds: true, + take: itemsPerPage, + skip: offset, + }); + if (total) { + return res.json({ + page: page, + totalPages: Math.ceil(total / itemsPerPage), + totalResults: total, + results: result, }); - if (total) { - return res.json({ - page: page, - totalPages: total / itemsPerPage, - totalResults: total, - results: result, - }); - } } + } - // We will just return an empty array if the user has no Plex token + // We will just return an empty array if the user has no Plex token + if (!user.plexToken) { return res.json({ page: 1, totalPages: 1, diff --git a/src/components/Discover/DiscoverWatchlist/index.tsx b/src/components/Discover/DiscoverWatchlist/index.tsx index 775da757a..a32fe5052 100644 --- a/src/components/Discover/DiscoverWatchlist/index.tsx +++ b/src/components/Discover/DiscoverWatchlist/index.tsx @@ -69,7 +69,7 @@ const DiscoverWatchlist = () => { title != null)} isEmpty={isEmpty} isLoading={ isLoadingInitialData || (isLoadingMore && (titles?.length ?? 0) > 0) diff --git a/src/components/UserProfile/index.tsx b/src/components/UserProfile/index.tsx index bb0f7504e..1dd466920 100644 --- a/src/components/UserProfile/index.tsx +++ b/src/components/UserProfile/index.tsx @@ -34,6 +34,7 @@ const messages = defineMessages({ seriesrequest: 'Series Requests', recentlywatched: 'Recently Watched', plexwatchlist: 'Plex Watchlist', + localWatchlist: "{username}'s Watchlist", emptywatchlist: 'Media added to your Plex Watchlist will appear here.', }); @@ -78,17 +79,17 @@ const UserProfile = () => { ? `/api/v1/user/${user.id}/watch_data` : null ); + const { data: watchlistItems, error: watchlistError } = useSWR( - user?.userType === UserType.PLEX && - (user.id === currentUser?.id || - currentHasPermission( - [Permission.MANAGE_REQUESTS, Permission.WATCHLIST_VIEW], - { - type: 'or', - } - )) - ? `/api/v1/user/${user.id}/watchlist` + user?.id === currentUser?.id || + currentHasPermission( + [Permission.MANAGE_REQUESTS, Permission.WATCHLIST_VIEW], + { + type: 'or', + } + ) + ? `/api/v1/user/${user?.id}/watchlist` : null, { revalidateOnMount: true, @@ -117,6 +118,13 @@ const UserProfile = () => { return ; } + const watchlistSliderTitle = intl.formatMessage( + user.userType === UserType.PLEX + ? messages.plexwatchlist + : messages.localWatchlist, + { username: user.displayName } + ); + return ( <> @@ -309,12 +317,11 @@ const UserProfile = () => { /> )} - {user.userType === UserType.PLEX && - (user.id === currentUser?.id || - currentHasPermission( - [Permission.MANAGE_REQUESTS, Permission.WATCHLIST_VIEW], - { type: 'or' } - )) && + {(user.id === currentUser?.id || + currentHasPermission( + [Permission.MANAGE_REQUESTS, Permission.WATCHLIST_VIEW], + { type: 'or' } + )) && (!watchlistItems || !!watchlistItems.results.length || (user.id === currentUser?.id && @@ -327,11 +334,11 @@ const UserProfile = () => { href={ user.id === currentUser?.id ? '/profile/watchlist' - : `/users/${user?.id}/watchlist` + : `/users/${user.id}/watchlist` } > - {intl.formatMessage(messages.plexwatchlist)} + {watchlistSliderTitle} diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index 837ac6001..96d5926c7 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -94,7 +94,6 @@ "components.Discover.emptywatchlist": "Media added to your Plex Watchlist will appear here.", "components.Discover.moviegenres": "Movie Genres", "components.Discover.networks": "Networks", - "components.Discover.noRequests": "No requests.", "components.Discover.plexwatchlist": "Your Watchlist", "components.Discover.popularmovies": "Popular Movies", "components.Discover.populartv": "Popular Series", @@ -200,9 +199,9 @@ "components.LanguageSelector.originalLanguageDefault": "All Languages", "components.Layout.LanguagePicker.displaylanguage": "Display Language", "components.Layout.SearchInput.searchPlaceholder": "Search Movies & TV", - "components.Layout.Sidebar.dashboard": "Discover", "components.Layout.Sidebar.browsemovies": "Movies", "components.Layout.Sidebar.browsetv": "Series", + "components.Layout.Sidebar.dashboard": "Discover", "components.Layout.Sidebar.issues": "Issues", "components.Layout.Sidebar.requests": "Requests", "components.Layout.Sidebar.settings": "Settings", @@ -218,11 +217,12 @@ "components.Layout.UserWarnings.passwordRequired": "A password is required.", "components.Layout.VersionStatus.commitsbehind": "{commitsBehind} {commitsBehind, plural, one {commit} other {commits}} behind", "components.Layout.VersionStatus.outofdate": "Out of Date", - "components.Layout.VersionStatus.streamdevelop": "Jellyseerr Develop", - "components.Layout.VersionStatus.streamstable": "Jellyseerr Stable", + "components.Layout.VersionStatus.streamdevelop": "Overseerr Develop", + "components.Layout.VersionStatus.streamstable": "Overseerr Stable", "components.Login.credentialerror": "The username or password is incorrect.", "components.Login.description": "Since this is your first time logging into {applicationName}, you are required to add a valid email address.", "components.Login.email": "Email Address", + "components.Login.emailtooltip": "Address does not need to be associated with your {mediaServerName} instance.", "components.Login.forgotpassword": "Forgot Password?", "components.Login.host": "{mediaServerName} URL", "components.Login.initialsignin": "Connect", @@ -582,7 +582,7 @@ "components.Settings.Notifications.NotificationsPushbullet.validationAccessTokenRequired": "You must provide an access token", "components.Settings.Notifications.NotificationsPushbullet.validationTypes": "You must select at least one notification type", "components.Settings.Notifications.NotificationsPushover.accessToken": "Application API Token", - "components.Settings.Notifications.NotificationsPushover.accessTokenTip": "Register an application for use with Jellyseerr", + "components.Settings.Notifications.NotificationsPushover.accessTokenTip": "Register an application for use with Overseerr", "components.Settings.Notifications.NotificationsPushover.agentenabled": "Enable Agent", "components.Settings.Notifications.NotificationsPushover.deviceDefault": "Device Default", "components.Settings.Notifications.NotificationsPushover.pushoversettingsfailed": "Pushover notification settings failed to save.", @@ -607,7 +607,7 @@ "components.Settings.Notifications.NotificationsSlack.webhookUrl": "Webhook URL", "components.Settings.Notifications.NotificationsSlack.webhookUrlTip": "Create an Incoming Webhook integration", "components.Settings.Notifications.NotificationsWebPush.agentenabled": "Enable Agent", - "components.Settings.Notifications.NotificationsWebPush.httpsRequirement": "In order to receive web push notifications, Jellyseerr must be served over HTTPS.", + "components.Settings.Notifications.NotificationsWebPush.httpsRequirement": "In order to receive web push notifications, Overseerr must be served over HTTPS.", "components.Settings.Notifications.NotificationsWebPush.toastWebPushTestFailed": "Web push test notification failed to send.", "components.Settings.Notifications.NotificationsWebPush.toastWebPushTestSending": "Sending web push test notification…", "components.Settings.Notifications.NotificationsWebPush.toastWebPushTestSuccess": "Web push test notification sent!", @@ -633,7 +633,7 @@ "components.Settings.Notifications.authPass": "SMTP Password", "components.Settings.Notifications.authUser": "SMTP Username", "components.Settings.Notifications.botAPI": "Bot Authorization Token", - "components.Settings.Notifications.botApiTip": "Create a bot for use with Jellyseerr", + "components.Settings.Notifications.botApiTip": "Create a bot for use with Overseerr", "components.Settings.Notifications.botAvatarUrl": "Bot Avatar URL", "components.Settings.Notifications.botUsername": "Bot Username", "components.Settings.Notifications.botUsernameTip": "Allow users to also start a chat with your bot and configure their own notifications", @@ -748,10 +748,10 @@ "components.Settings.SettingsAbout.githubdiscussions": "GitHub Discussions", "components.Settings.SettingsAbout.helppaycoffee": "Help Pay for Coffee", "components.Settings.SettingsAbout.outofdate": "Out of Date", - "components.Settings.SettingsAbout.overseerrinformation": "About Jellyseerr", + "components.Settings.SettingsAbout.overseerrinformation": "About Overseerr", "components.Settings.SettingsAbout.preferredmethod": "Preferred", - "components.Settings.SettingsAbout.runningDevelop": "You are running the develop branch of Jellyseerr, which is only recommended for those contributing to development or assisting with bleeding-edge testing.", - "components.Settings.SettingsAbout.supportoverseerr": "Support Jellyseerr", + "components.Settings.SettingsAbout.runningDevelop": "You are running the develop branch of Overseerr, which is only recommended for those contributing to development or assisting with bleeding-edge testing.", + "components.Settings.SettingsAbout.supportoverseerr": "Support Overseerr", "components.Settings.SettingsAbout.timezone": "Time Zone", "components.Settings.SettingsAbout.totalmedia": "Total Media", "components.Settings.SettingsAbout.totalrequests": "Total Requests", @@ -759,7 +759,7 @@ "components.Settings.SettingsAbout.version": "Version", "components.Settings.SettingsJobsCache.availability-sync": "Media Availability Sync", "components.Settings.SettingsJobsCache.cache": "Cache", - "components.Settings.SettingsJobsCache.cacheDescription": "Jellyseerr caches requests to external API endpoints to optimize performance and avoid making unnecessary API calls.", + "components.Settings.SettingsJobsCache.cacheDescription": "Overseerr caches requests to external API endpoints to optimize performance and avoid making unnecessary API calls.", "components.Settings.SettingsJobsCache.cacheflushed": "{cachename} cache flushed.", "components.Settings.SettingsJobsCache.cachehits": "Hits", "components.Settings.SettingsJobsCache.cachekeys": "Total Keys", @@ -780,7 +780,7 @@ "components.Settings.SettingsJobsCache.flushcache": "Flush Cache", "components.Settings.SettingsJobsCache.image-cache-cleanup": "Image Cache Cleanup", "components.Settings.SettingsJobsCache.imagecache": "Image Cache", - "components.Settings.SettingsJobsCache.imagecacheDescription": "When enabled in settings, Jellyseerr will proxy and cache images from pre-configured external sources. Cached images are saved into your config folder. You can find the files in {appDataPath}/cache/images.", + "components.Settings.SettingsJobsCache.imagecacheDescription": "When enabled in settings, Overseerr will proxy and cache images from pre-configured external sources. Cached images are saved into your config folder. You can find the files in {appDataPath}/cache/images.", "components.Settings.SettingsJobsCache.imagecachecount": "Images Cached", "components.Settings.SettingsJobsCache.imagecachesize": "Total Cache Size", "components.Settings.SettingsJobsCache.jellyfin-full-scan": "Jellyfin Full Library Scan", @@ -790,7 +790,7 @@ "components.Settings.SettingsJobsCache.jobcancelled": "{jobname} canceled.", "components.Settings.SettingsJobsCache.jobname": "Job Name", "components.Settings.SettingsJobsCache.jobs": "Jobs", - "components.Settings.SettingsJobsCache.jobsDescription": "Jellyseerr performs certain maintenance tasks as regularly-scheduled jobs, but they can also be manually triggered below. Manually running a job will not alter its schedule.", + "components.Settings.SettingsJobsCache.jobsDescription": "Overseerr performs certain maintenance tasks as regularly-scheduled jobs, but they can also be manually triggered below. Manually running a job will not alter its schedule.", "components.Settings.SettingsJobsCache.jobsandcache": "Jobs & Cache", "components.Settings.SettingsJobsCache.jobstarted": "{jobname} started.", "components.Settings.SettingsJobsCache.jobtype": "Type", @@ -831,7 +831,7 @@ "components.Settings.SettingsMain.csrfProtectionTip": "Set external API access to read-only (requires HTTPS)", "components.Settings.SettingsMain.general": "General", "components.Settings.SettingsMain.generalsettings": "General Settings", - "components.Settings.SettingsMain.generalsettingsDescription": "Configure global and default settings for Jellyseerr.", + "components.Settings.SettingsMain.generalsettingsDescription": "Configure global and default settings for Overseerr.", "components.Settings.SettingsMain.hideAvailable": "Hide Available Media", "components.Settings.SettingsMain.locale": "Display Language", "components.Settings.SettingsMain.originallanguage": "Discover Language", @@ -844,7 +844,7 @@ "components.Settings.SettingsMain.toastSettingsFailure": "Something went wrong while saving settings.", "components.Settings.SettingsMain.toastSettingsSuccess": "Settings saved successfully!", "components.Settings.SettingsMain.trustProxy": "Enable Proxy Support", - "components.Settings.SettingsMain.trustProxyTip": "Allow Jellyseerr to correctly register client IP addresses behind a proxy", + "components.Settings.SettingsMain.trustProxyTip": "Allow Overseerr to correctly register client IP addresses behind a proxy", "components.Settings.SettingsMain.validationApplicationTitle": "You must provide an application title", "components.Settings.SettingsMain.validationApplicationUrl": "You must provide a valid URL", "components.Settings.SettingsMain.validationApplicationUrlTrailingSlash": "URL must not end in a trailing slash", @@ -946,7 +946,7 @@ "components.Settings.jellyfinsettingsDescription": "Configure the settings for your {mediaServerName} server. {mediaServerName} scans your {mediaServerName} libraries to see what content is available.", "components.Settings.librariesRemaining": "Libraries Remaining: {count}", "components.Settings.manualscan": "Manual Library Scan", - "components.Settings.manualscanDescription": "Normally, this will only be run once every 24 hours. Jellyseerr will check your Plex server's recently added more aggressively. If this is your first time configuring Plex, a one-time full manual library scan is recommended!", + "components.Settings.manualscanDescription": "Normally, this will only be run once every 24 hours. Overseerr will check your Plex server's recently added more aggressively. If this is your first time configuring Plex, a one-time full manual library scan is recommended!", "components.Settings.manualscanDescriptionJellyfin": "Normally, this will only be run once every 24 hours. Jellyseerr will check your {mediaServerName} server's recently added more aggressively. If this is your first time configuring Jellyseerr, a one-time full manual library scan is recommended!", "components.Settings.manualscanJellyfin": "Manual Library Scan", "components.Settings.mediaTypeMovie": "movie", @@ -969,12 +969,12 @@ "components.Settings.notrunning": "Not Running", "components.Settings.plex": "Plex", "components.Settings.plexlibraries": "Plex Libraries", - "components.Settings.plexlibrariesDescription": "The libraries Jellyseerr scans for titles. Set up and save your Plex connection settings, then click the button below if no libraries are listed.", + "components.Settings.plexlibrariesDescription": "The libraries Overseerr scans for titles. Set up and save your Plex connection settings, then click the button below if no libraries are listed.", "components.Settings.plexsettings": "Plex Settings", - "components.Settings.plexsettingsDescription": "Configure the settings for your Plex server. Jellyseerr scans your Plex libraries to determine content availability.", + "components.Settings.plexsettingsDescription": "Configure the settings for your Plex server. Overseerr scans your Plex libraries to determine content availability.", "components.Settings.port": "Port", "components.Settings.radarrsettings": "Radarr Settings", - "components.Settings.restartrequiredTooltip": "Jellyseerr must be restarted for changes to this setting to take effect", + "components.Settings.restartrequiredTooltip": "Overseerr must be restarted for changes to this setting to take effect", "components.Settings.save": "Save Changes", "components.Settings.saving": "Saving…", "components.Settings.scan": "Sync Libraries", @@ -996,7 +996,7 @@ "components.Settings.syncing": "Syncing", "components.Settings.tautulliApiKey": "API Key", "components.Settings.tautulliSettings": "Tautulli Settings", - "components.Settings.tautulliSettingsDescription": "Optionally configure the settings for your Tautulli server. Jellyseerr fetches watch history data for your Plex media from Tautulli.", + "components.Settings.tautulliSettingsDescription": "Optionally configure the settings for your Tautulli server. Overseerr fetches watch history data for your Plex media from Tautulli.", "components.Settings.timeout": "Timeout", "components.Settings.toastPlexConnecting": "Attempting to connect to Plex…", "components.Settings.toastPlexConnectingFailure": "Failed to connect to Plex.", @@ -1042,10 +1042,15 @@ "components.StatusChecker.reloadApp": "Reload {applicationTitle}", "components.StatusChecker.restartRequired": "Server Restart Required", "components.StatusChecker.restartRequiredDescription": "Please restart the server to apply the updated settings.", + "components.TitleCard.addToWatchList": "Add to watchlist", "components.TitleCard.cleardata": "Clear Data", "components.TitleCard.mediaerror": "{mediaType} Not Found", "components.TitleCard.tmdbid": "TMDB ID", "components.TitleCard.tvdbid": "TheTVDB ID", + "components.TitleCard.watchlistCancel": "watchlist for {title} canceled.", + "components.TitleCard.watchlistDeleted": "{title} Removed from watchlist successfully!", + "components.TitleCard.watchlistError": "Something went wrong try again.", + "components.TitleCard.watchlistSuccess": "{title} added to watchlist successfully!", "components.TvDetails.Season.noepisodes": "Episode list unavailable.", "components.TvDetails.Season.somethingwentwrong": "Something went wrong while retrieving season data.", "components.TvDetails.TvCast.fullseriescast": "Full Series Cast", @@ -1229,6 +1234,7 @@ "components.UserProfile.UserSettings.unauthorizedDescription": "You do not have permission to modify this user's settings.", "components.UserProfile.emptywatchlist": "Media added to your Plex Watchlist will appear here.", "components.UserProfile.limit": "{remaining} of {limit}", + "components.UserProfile.localWatchlist": "{username}'s Watchlist", "components.UserProfile.movierequests": "Movie Requests", "components.UserProfile.pastdays": "{type} (past {days} days)", "components.UserProfile.plexwatchlist": "Plex Watchlist", @@ -1238,11 +1244,6 @@ "components.UserProfile.seriesrequest": "Series Requests", "components.UserProfile.totalrequests": "Total Requests", "components.UserProfile.unlimited": "Unlimited", - "components.TitleCard.addToWatchList": "Add to watchlist", - "components.TitleCard.watchlistCancel": "watchlist for {title} canceled.", - "components.TitleCard.watchlistDeleted": "{title} Removed from watchlist successfully!", - "components.TitleCard.watchlistError": "Something went wrong try again.", - "components.TitleCard.watchlistSuccess": "{title} added to watchlist successfully!", "i18n.advanced": "Advanced", "i18n.all": "All", "i18n.approve": "Approve", From 67bde685963684682b9a472f896c107271a5c328 Mon Sep 17 00:00:00 2001 From: fallenbagel <98979876+Fallenbagel@users.noreply.github.com> Date: Wed, 8 Nov 2023 01:04:20 +0500 Subject: [PATCH 2/3] refactor: cleans up local watchlist logic and fixes translation extractions --- server/routes/discover.ts | 1 + .../Discover/DiscoverWatchlist/index.tsx | 2 +- src/components/Layout/VersionStatus/index.tsx | 4 +- .../NotificationsPushover/index.tsx | 2 +- .../Notifications/NotificationsTelegram.tsx | 2 +- .../NotificationsWebPush/index.tsx | 2 +- .../Settings/SettingsAbout/index.tsx | 53 ++++++++++++++++++- src/components/Settings/SettingsBadge.tsx | 2 +- .../Settings/SettingsJobsCache/index.tsx | 6 +-- .../Settings/SettingsMain/index.tsx | 4 +- src/components/Settings/SettingsPlex.tsx | 6 +-- src/i18n/locale/en.json | 1 + 12 files changed, 68 insertions(+), 17 deletions(-) diff --git a/server/routes/discover.ts b/server/routes/discover.ts index 88d893cae..e9647895a 100644 --- a/server/routes/discover.ts +++ b/server/routes/discover.ts @@ -865,6 +865,7 @@ discoverRoutes.get, WatchlistResponse>( } const plexTV = new PlexTvAPI(activeUser.plexToken); + const watchlist = await plexTV.getWatchlist({ offset }); return res.json({ diff --git a/src/components/Discover/DiscoverWatchlist/index.tsx b/src/components/Discover/DiscoverWatchlist/index.tsx index a32fe5052..775da757a 100644 --- a/src/components/Discover/DiscoverWatchlist/index.tsx +++ b/src/components/Discover/DiscoverWatchlist/index.tsx @@ -69,7 +69,7 @@ const DiscoverWatchlist = () => { title != null)} + plexItems={titles} isEmpty={isEmpty} isLoading={ isLoadingInitialData || (isLoadingMore && (titles?.length ?? 0) > 0) diff --git a/src/components/Layout/VersionStatus/index.tsx b/src/components/Layout/VersionStatus/index.tsx index e755750ea..def6a7c68 100644 --- a/src/components/Layout/VersionStatus/index.tsx +++ b/src/components/Layout/VersionStatus/index.tsx @@ -10,8 +10,8 @@ import { defineMessages, useIntl } from 'react-intl'; import useSWR from 'swr'; const messages = defineMessages({ - streamdevelop: 'Overseerr Develop', - streamstable: 'Overseerr Stable', + streamdevelop: 'Jellyseerr Develop', + streamstable: 'Jellyseerr Stable', outofdate: 'Out of Date', commitsbehind: '{commitsBehind} {commitsBehind, plural, one {commit} other {commits}} behind', diff --git a/src/components/Settings/Notifications/NotificationsPushover/index.tsx b/src/components/Settings/Notifications/NotificationsPushover/index.tsx index 68a321540..325dbd315 100644 --- a/src/components/Settings/Notifications/NotificationsPushover/index.tsx +++ b/src/components/Settings/Notifications/NotificationsPushover/index.tsx @@ -16,7 +16,7 @@ const messages = defineMessages({ agentenabled: 'Enable Agent', accessToken: 'Application API Token', accessTokenTip: - 'Register an application for use with Overseerr', + 'Register an application for use with Jellyseerr', userToken: 'User or Group Key', userTokenTip: 'Your 30-character user or group identifier', diff --git a/src/components/Settings/Notifications/NotificationsTelegram.tsx b/src/components/Settings/Notifications/NotificationsTelegram.tsx index 690731e6e..6907906a5 100644 --- a/src/components/Settings/Notifications/NotificationsTelegram.tsx +++ b/src/components/Settings/Notifications/NotificationsTelegram.tsx @@ -19,7 +19,7 @@ const messages = defineMessages({ 'Allow users to also start a chat with your bot and configure their own notifications', botAPI: 'Bot Authorization Token', botApiTip: - 'Create a bot for use with Overseerr', + 'Create a bot for use with Jellyseerr', chatId: 'Chat ID', chatIdTip: 'Start a chat with your bot, add @get_id_bot, and issue the /my_id command', diff --git a/src/components/Settings/Notifications/NotificationsWebPush/index.tsx b/src/components/Settings/Notifications/NotificationsWebPush/index.tsx index 5ff7ebf5f..a5627ed33 100644 --- a/src/components/Settings/Notifications/NotificationsWebPush/index.tsx +++ b/src/components/Settings/Notifications/NotificationsWebPush/index.tsx @@ -18,7 +18,7 @@ const messages = defineMessages({ toastWebPushTestSuccess: 'Web push test notification sent!', toastWebPushTestFailed: 'Web push test notification failed to send.', httpsRequirement: - 'In order to receive web push notifications, Overseerr must be served over HTTPS.', + 'In order to receive web push notifications, Jellyseerr must be served over HTTPS.', }); const NotificationsWebPush = () => { diff --git a/src/components/Settings/SettingsAbout/index.tsx b/src/components/Settings/SettingsAbout/index.tsx index b3df332b4..e5830ebcd 100644 --- a/src/components/Settings/SettingsAbout/index.tsx +++ b/src/components/Settings/SettingsAbout/index.tsx @@ -16,7 +16,7 @@ import useSWR from 'swr'; const messages = defineMessages({ about: 'About', - overseerrinformation: 'About Overseerr', + overseerrinformation: 'About Jellyseerr', version: 'Version', totalmedia: 'Total Media', totalrequests: 'Total Requests', @@ -25,6 +25,7 @@ const messages = defineMessages({ timezone: 'Time Zone', appDataPath: 'Data Directory', supportoverseerr: 'Support Overseerr', + supportjellyseerr: 'Support Jellyseerr', helppaycoffee: 'Help Pay for Coffee', documentation: 'Documentation', preferredmethod: 'Preferred', @@ -33,7 +34,7 @@ const messages = defineMessages({ betawarning: 'This is BETA software. Features may be broken and/or unstable. Please report any issues on GitHub!', runningDevelop: - 'You are running the develop branch of Overseerr, which is only recommended for those contributing to development or assisting with bleeding-edge testing.', + 'You are running the develop branch of Jellyseerr, which is only recommended for those contributing to development or assisting with bleeding-edge testing.', }); const SettingsAbout = () => { @@ -187,6 +188,54 @@ const SettingsAbout = () => { +
+ + + + https://github.com/sponsors/sct + + + {intl.formatMessage(messages.preferredmethod)} + + + + + https://patreon.com/overseerr + + + +
+
+ + + + https://www.buymeacoffee.com/fallen.bagel + + + {intl.formatMessage(messages.preferredmethod)} + + + +
diff --git a/src/components/Settings/SettingsBadge.tsx b/src/components/Settings/SettingsBadge.tsx index c4f12ef31..3b26bef29 100644 --- a/src/components/Settings/SettingsBadge.tsx +++ b/src/components/Settings/SettingsBadge.tsx @@ -9,7 +9,7 @@ const messages = defineMessages({ experimentalTooltip: 'Enabling this setting may result in unexpected application behavior', restartrequiredTooltip: - 'Overseerr must be restarted for changes to this setting to take effect', + 'Jellyseerr must be restarted for changes to this setting to take effect', }); const SettingsBadge = ({ diff --git a/src/components/Settings/SettingsJobsCache/index.tsx b/src/components/Settings/SettingsJobsCache/index.tsx index ae0f7ee4d..1686fce22 100644 --- a/src/components/Settings/SettingsJobsCache/index.tsx +++ b/src/components/Settings/SettingsJobsCache/index.tsx @@ -30,7 +30,7 @@ const messages: { [messageName: string]: MessageDescriptor } = defineMessages({ jobsandcache: 'Jobs & Cache', jobs: 'Jobs', jobsDescription: - 'Overseerr performs certain maintenance tasks as regularly-scheduled jobs, but they can also be manually triggered below. Manually running a job will not alter its schedule.', + 'Jellyseerr performs certain maintenance tasks as regularly-scheduled jobs, but they can also be manually triggered below. Manually running a job will not alter its schedule.', jobname: 'Job Name', jobtype: 'Type', nextexecution: 'Next Execution', @@ -42,7 +42,7 @@ const messages: { [messageName: string]: MessageDescriptor } = defineMessages({ command: 'Command', cache: 'Cache', cacheDescription: - 'Overseerr caches requests to external API endpoints to optimize performance and avoid making unnecessary API calls.', + 'Jellyseerr caches requests to external API endpoints to optimize performance and avoid making unnecessary API calls.', cacheflushed: '{cachename} cache flushed.', cachename: 'Cache Name', cachehits: 'Hits', @@ -76,7 +76,7 @@ const messages: { [messageName: string]: MessageDescriptor } = defineMessages({ 'Every {jobScheduleSeconds, plural, one {second} other {{jobScheduleSeconds} seconds}}', imagecache: 'Image Cache', imagecacheDescription: - 'When enabled in settings, Overseerr will proxy and cache images from pre-configured external sources. Cached images are saved into your config folder. You can find the files in {appDataPath}/cache/images.', + 'When enabled in settings, Jellyseerr will proxy and cache images from pre-configured external sources. Cached images are saved into your config folder. You can find the files in {appDataPath}/cache/images.', imagecachecount: 'Images Cached', imagecachesize: 'Total Cache Size', }); diff --git a/src/components/Settings/SettingsMain/index.tsx b/src/components/Settings/SettingsMain/index.tsx index 62f26d49a..b9f285ce7 100644 --- a/src/components/Settings/SettingsMain/index.tsx +++ b/src/components/Settings/SettingsMain/index.tsx @@ -27,7 +27,7 @@ const messages = defineMessages({ general: 'General', generalsettings: 'General Settings', generalsettingsDescription: - 'Configure global and default settings for Overseerr.', + 'Configure global and default settings for Jellyseerr.', apikey: 'API Key', applicationTitle: 'Application Title', applicationurl: 'Application URL', @@ -49,7 +49,7 @@ const messages = defineMessages({ 'Cache externally sourced images (requires a significant amount of disk space)', trustProxy: 'Enable Proxy Support', trustProxyTip: - 'Allow Overseerr to correctly register client IP addresses behind a proxy', + 'Allow Jellyseerr to correctly register client IP addresses behind a proxy', validationApplicationTitle: 'You must provide an application title', validationApplicationUrl: 'You must provide a valid URL', validationApplicationUrlTrailingSlash: 'URL must not end in a trailing slash', diff --git a/src/components/Settings/SettingsPlex.tsx b/src/components/Settings/SettingsPlex.tsx index 1414f0174..69d988895 100644 --- a/src/components/Settings/SettingsPlex.tsx +++ b/src/components/Settings/SettingsPlex.tsx @@ -49,12 +49,12 @@ const messages = defineMessages({ enablessl: 'Use SSL', plexlibraries: 'Plex Libraries', plexlibrariesDescription: - 'The libraries Overseerr scans for titles. Set up and save your Plex connection settings, then click the button below if no libraries are listed.', + 'The libraries Jellyseerr scans for titles. Set up and save your Plex connection settings, then click the button below if no libraries are listed.', scanning: 'Syncing…', scan: 'Sync Libraries', manualscan: 'Manual Library Scan', manualscanDescription: - "Normally, this will only be run once every 24 hours. Overseerr will check your Plex server's recently added more aggressively. If this is your first time configuring Plex, a one-time full manual library scan is recommended!", + "Normally, this will only be run once every 24 hours. Jellyseerr will check your Plex server's recently added more aggressively. If this is your first time configuring Plex, a one-time full manual library scan is recommended!", notrunning: 'Not Running', currentlibrary: 'Current Library: {name}', librariesRemaining: 'Libraries Remaining: {count}', @@ -67,7 +67,7 @@ const messages = defineMessages({ 'Optionally direct users to the web app on your server instead of the "hosted" web app', tautulliSettings: 'Tautulli Settings', tautulliSettingsDescription: - 'Optionally configure the settings for your Tautulli server. Overseerr fetches watch history data for your Plex media from Tautulli.', + 'Optionally configure the settings for your Tautulli server. Jellyseerr fetches watch history data for your Plex media from Tautulli.', urlBase: 'URL Base', tautulliApiKey: 'API Key', externalUrl: 'External URL', diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index 96d5926c7..d355b6efd 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -752,6 +752,7 @@ "components.Settings.SettingsAbout.preferredmethod": "Preferred", "components.Settings.SettingsAbout.runningDevelop": "You are running the develop branch of Overseerr, which is only recommended for those contributing to development or assisting with bleeding-edge testing.", "components.Settings.SettingsAbout.supportoverseerr": "Support Overseerr", + "components.Settings.SettingsAbout.supportjellyseerr": "Support Jellyseerr", "components.Settings.SettingsAbout.timezone": "Time Zone", "components.Settings.SettingsAbout.totalmedia": "Total Media", "components.Settings.SettingsAbout.totalrequests": "Total Requests", From 8c82a61450a7525c0e2f1b64e6939da47a7c715d Mon Sep 17 00:00:00 2001 From: fallenbagel <98979876+Fallenbagel@users.noreply.github.com> Date: Wed, 8 Nov 2023 01:24:18 +0500 Subject: [PATCH 3/3] fix: fix the translations for watchlist permissions and userSettings page --- src/components/PermissionEdit/index.tsx | 27 ++++++++++++++++--- .../Settings/SettingsUsers/index.tsx | 13 +++++++-- src/i18n/locale/en.json | 6 ++--- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/components/PermissionEdit/index.tsx b/src/components/PermissionEdit/index.tsx index 768b9281c..82971bf03 100644 --- a/src/components/PermissionEdit/index.tsx +++ b/src/components/PermissionEdit/index.tsx @@ -1,7 +1,9 @@ import type { PermissionItem } from '@app/components/PermissionOption'; import PermissionOption from '@app/components/PermissionOption'; +import useSettings from '@app/hooks/useSettings'; import type { User } from '@app/hooks/useUser'; import { Permission } from '@app/hooks/useUser'; +import { MediaServerType } from '@server/constants/server'; import { defineMessages, useIntl } from 'react-intl'; export const messages = defineMessages({ @@ -72,9 +74,9 @@ export const messages = defineMessages({ viewrecent: 'View Recently Added', viewrecentDescription: 'Grant permission to view the list of recently added media.', - viewwatchlists: 'View Plex Watchlists', + viewwatchlists: 'View {mediaServerName} Watchlists', viewwatchlistsDescription: - "Grant permission to view other users' Plex Watchlists.", + "Grant permission to view other users' {mediaServerName} Watchlists.", }); interface PermissionEditProps { @@ -91,6 +93,7 @@ export const PermissionEdit = ({ onUpdate, }: PermissionEditProps) => { const intl = useIntl(); + const settings = useSettings(); const permissionList: PermissionItem[] = [ { @@ -131,8 +134,24 @@ export const PermissionEdit = ({ }, { id: 'viewwatchlists', - name: intl.formatMessage(messages.viewwatchlists), - description: intl.formatMessage(messages.viewwatchlistsDescription), + name: intl.formatMessage(messages.viewwatchlists, { + mediaServerName: + settings.currentSettings.mediaServerType === MediaServerType.PLEX + ? 'Plex' + : settings.currentSettings.mediaServerType === + MediaServerType.JELLYFIN + ? 'Jellyfin' + : 'Emby', + }), + description: intl.formatMessage(messages.viewwatchlistsDescription, { + mediaServerName: + settings.currentSettings.mediaServerType === MediaServerType.PLEX + ? 'Plex' + : settings.currentSettings.mediaServerType === + MediaServerType.JELLYFIN + ? 'Jellyfin' + : 'Emby', + }), permission: Permission.WATCHLIST_VIEW, }, ], diff --git a/src/components/Settings/SettingsUsers/index.tsx b/src/components/Settings/SettingsUsers/index.tsx index e420977b1..ff6126c5e 100644 --- a/src/components/Settings/SettingsUsers/index.tsx +++ b/src/components/Settings/SettingsUsers/index.tsx @@ -23,7 +23,7 @@ const messages = defineMessages({ toastSettingsFailure: 'Something went wrong while saving settings.', localLogin: 'Enable Local Sign-In', localLoginTip: - 'Allow users to sign in using their email address and password, instead of Plex OAuth', + 'Allow users to sign in using their email address and password, instead of {mediaServerName} OAuth', newPlexLogin: 'Enable New {mediaServerName} Sign-In', newPlexLoginTip: 'Allow {mediaServerName} users to sign in without first being imported', @@ -114,7 +114,16 @@ const SettingsUsers = () => {
diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index d355b6efd..906892b04 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -394,8 +394,8 @@ "components.PermissionEdit.viewrecentDescription": "Grant permission to view the list of recently added media.", "components.PermissionEdit.viewrequests": "View Requests", "components.PermissionEdit.viewrequestsDescription": "Grant permission to view media requests submitted by other users.", - "components.PermissionEdit.viewwatchlists": "View Plex Watchlists", - "components.PermissionEdit.viewwatchlistsDescription": "Grant permission to view other users' Plex Watchlists.", + "components.PermissionEdit.viewwatchlists": "View {mediaServerName} Watchlists", + "components.PermissionEdit.viewwatchlistsDescription": "Grant permission to view other users' {mediaServerName} Watchlists.", "components.PersonDetails.alsoknownas": "Also Known As: {names}", "components.PersonDetails.appearsin": "Appearances", "components.PersonDetails.ascharacter": "as {character}", @@ -852,7 +852,7 @@ "components.Settings.SettingsUsers.defaultPermissions": "Default Permissions", "components.Settings.SettingsUsers.defaultPermissionsTip": "Initial permissions assigned to new users", "components.Settings.SettingsUsers.localLogin": "Enable Local Sign-In", - "components.Settings.SettingsUsers.localLoginTip": "Allow users to sign in using their email address and password, instead of Plex OAuth", + "components.Settings.SettingsUsers.localLoginTip": "Allow users to sign in using their email address and password, instead of {mediaServerName} OAuth", "components.Settings.SettingsUsers.movieRequestLimitLabel": "Global Movie Request Limit", "components.Settings.SettingsUsers.newPlexLogin": "Enable New {mediaServerName} Sign-In", "components.Settings.SettingsUsers.newPlexLoginTip": "Allow {mediaServerName} users to sign in without first being imported",