diff --git a/cypress/config/settings.cypress.json b/cypress/config/settings.cypress.json index 45e38a29e..5dc717075 100644 --- a/cypress/config/settings.cypress.json +++ b/cypress/config/settings.cypress.json @@ -16,7 +16,8 @@ "hideAvailable": false, "localLogin": true, "newPlexLogin": true, - "region": "", + "discoverRegion": "", + "streamingRegion": "", "originalLanguage": "", "trustProxy": false, "mediaServerType": 1, diff --git a/docs/using-jellyseerr/settings/general.md b/docs/using-jellyseerr/settings/general.md index 61991ed0a..08601d2a7 100644 --- a/docs/using-jellyseerr/settings/general.md +++ b/docs/using-jellyseerr/settings/general.md @@ -58,9 +58,9 @@ You should enable this if you are having issues with loading images directly fro Set the default display language for Jellyseerr. Users can override this setting in their user settings. -## Discover Region & Discover Language +## Discover Region, Discover Language & Streaming Region -These settings filter content shown on the "Discover" home page based on regional availability and original language, respectively. Users can override these global settings by configuring these same options in their user settings. +These settings filter content shown on the "Discover" home page based on regional availability and original language, respectively. The Streaming Region filters the available streaming providers on the media page. Users can override these global settings by configuring these same options in their user settings. ## Hide Available Media diff --git a/docs/using-jellyseerr/users/editing-users.md b/docs/using-jellyseerr/users/editing-users.md index fb2b80ab7..8a04c3add 100644 --- a/docs/using-jellyseerr/users/editing-users.md +++ b/docs/using-jellyseerr/users/editing-users.md @@ -35,7 +35,7 @@ Users can override the [global display language](/using-jellyseerr/settings/gene ### Discover Region & Discover Language -Users can override the [global filter settings](/using-jellyseerr/settings/general#discover-region--discover-language) to suit their own preferences. +Users can override the [global filter settings](/using-jellyseerr/settings/general#discover-region-discover-language--streaming-region) to suit their own preferences. ### Movie Request Limit & Series Request Limit diff --git a/overseerr-api.yml b/overseerr-api.yml index 9e2505f48..914a11fac 100644 --- a/overseerr-api.yml +++ b/overseerr-api.yml @@ -143,10 +143,12 @@ components: properties: locale: type: string - region: + discoverRegion: type: string originalLanguage: type: string + streamingRegion: + type: string MainSettings: type: object properties: diff --git a/server/api/themoviedb/index.ts b/server/api/themoviedb/index.ts index 6f13ec08a..016da27a3 100644 --- a/server/api/themoviedb/index.ts +++ b/server/api/themoviedb/index.ts @@ -99,12 +99,12 @@ interface DiscoverTvOptions { } class TheMovieDb extends ExternalAPI { - private region?: string; + private discoverRegion?: string; private originalLanguage?: string; constructor({ - region, + discoverRegion, originalLanguage, - }: { region?: string; originalLanguage?: string } = {}) { + }: { discoverRegion?: string; originalLanguage?: string } = {}) { super( 'https://api.themoviedb.org/3', { @@ -118,7 +118,7 @@ class TheMovieDb extends ExternalAPI { }, } ); - this.region = region; + this.discoverRegion = discoverRegion; this.originalLanguage = originalLanguage; } @@ -469,7 +469,7 @@ class TheMovieDb extends ExternalAPI { page: page.toString(), include_adult: includeAdult ? 'true' : 'false', language, - region: this.region || '', + region: this.discoverRegion || '', with_original_language: originalLanguage && originalLanguage !== 'all' ? originalLanguage @@ -541,7 +541,7 @@ class TheMovieDb extends ExternalAPI { sort_by: sortBy, page: page.toString(), language, - region: this.region || '', + region: this.discoverRegion || '', // Set our release date values, but check if one is set and not the other, // so we can force a past date or a future date. TMDB Requires both values if one is set! 'first_air_date.gte': @@ -594,7 +594,7 @@ class TheMovieDb extends ExternalAPI { { page: page.toString(), language, - region: this.region || '', + region: this.discoverRegion || '', originalLanguage: this.originalLanguage || '', } ); @@ -620,7 +620,7 @@ class TheMovieDb extends ExternalAPI { { page: page.toString(), language, - region: this.region || '', + region: this.discoverRegion || '', } ); diff --git a/server/entity/UserSettings.ts b/server/entity/UserSettings.ts index ea4a7d33b..d5a7555a8 100644 --- a/server/entity/UserSettings.ts +++ b/server/entity/UserSettings.ts @@ -31,7 +31,10 @@ export class UserSettings { public locale?: string; @Column({ nullable: true }) - public region?: string; + public discoverRegion?: string; + + @Column({ nullable: true }) + public streamingRegion?: string; @Column({ nullable: true }) public originalLanguage?: string; diff --git a/server/interfaces/api/settingsInterfaces.ts b/server/interfaces/api/settingsInterfaces.ts index 579f11093..29a81d5ed 100644 --- a/server/interfaces/api/settingsInterfaces.ts +++ b/server/interfaces/api/settingsInterfaces.ts @@ -32,7 +32,8 @@ export interface PublicSettingsResponse { localLogin: boolean; movie4kEnabled: boolean; series4kEnabled: boolean; - region: string; + discoverRegion: string; + streamingRegion: string; originalLanguage: string; mediaServerType: number; partialRequestsEnabled: boolean; diff --git a/server/interfaces/api/userSettingsInterfaces.ts b/server/interfaces/api/userSettingsInterfaces.ts index 53b6729c9..43c567c7f 100644 --- a/server/interfaces/api/userSettingsInterfaces.ts +++ b/server/interfaces/api/userSettingsInterfaces.ts @@ -5,7 +5,8 @@ export interface UserSettingsGeneralResponse { email?: string; discordId?: string; locale?: string; - region?: string; + discoverRegion?: string; + streamingRegion?: string; originalLanguage?: string; movieQuotaLimit?: number; movieQuotaDays?: number; diff --git a/server/lib/settings/index.ts b/server/lib/settings/index.ts index 29447f534..a77a9314c 100644 --- a/server/lib/settings/index.ts +++ b/server/lib/settings/index.ts @@ -124,7 +124,8 @@ export interface MainSettings { hideAvailable: boolean; localLogin: boolean; newPlexLogin: boolean; - region: string; + discoverRegion: string; + streamingRegion: string; originalLanguage: string; trustProxy: boolean; mediaServerType: number; @@ -144,7 +145,8 @@ interface FullPublicSettings extends PublicSettings { localLogin: boolean; movie4kEnabled: boolean; series4kEnabled: boolean; - region: string; + discoverRegion: string; + streamingRegion: string; originalLanguage: string; mediaServerType: number; jellyfinExternalHost?: string; @@ -331,7 +333,8 @@ class Settings { hideAvailable: false, localLogin: true, newPlexLogin: true, - region: '', + discoverRegion: '', + streamingRegion: '', originalLanguage: '', trustProxy: false, mediaServerType: MediaServerType.NOT_CONFIGURED, @@ -570,7 +573,8 @@ class Settings { series4kEnabled: this.data.sonarr.some( (sonarr) => sonarr.is4k && sonarr.isDefault ), - region: this.data.main.region, + discoverRegion: this.data.main.discoverRegion, + streamingRegion: this.data.main.streamingRegion, originalLanguage: this.data.main.originalLanguage, mediaServerType: this.main.mediaServerType, partialRequestsEnabled: this.data.main.partialRequestsEnabled, diff --git a/server/lib/settings/migrations/0004_migrate_region_setting.ts b/server/lib/settings/migrations/0004_migrate_region_setting.ts new file mode 100644 index 000000000..35769fe75 --- /dev/null +++ b/server/lib/settings/migrations/0004_migrate_region_setting.ts @@ -0,0 +1,17 @@ +import type { AllSettings } from '@server/lib/settings'; + +const migrateHostname = (settings: any): AllSettings => { + const oldRegion = settings.main.region; + if (oldRegion) { + settings.main.discoverRegion = oldRegion; + settings.main.streamingRegion = oldRegion; + } else { + settings.main.discoverRegion = ''; + settings.main.streamingRegion = 'US'; + } + delete settings.main.region; + + return settings; +}; + +export default migrateHostname; diff --git a/server/migration/1727907530757-AddUserSettingsStreamingRegion.ts b/server/migration/1727907530757-AddUserSettingsStreamingRegion.ts new file mode 100644 index 000000000..bd7a183b2 --- /dev/null +++ b/server/migration/1727907530757-AddUserSettingsStreamingRegion.ts @@ -0,0 +1,53 @@ +import type { MigrationInterface, QueryRunner } from 'typeorm'; + +export class AddUserSettingsStreamingRegion1727907530757 + implements MigrationInterface +{ + name = 'AddUserSettingsStreamingRegion1727907530757'; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `CREATE TABLE "temporary_user_settings" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "notificationTypes" text, "discordId" varchar, "userId" integer, "originalLanguage" varchar, "telegramChatId" varchar, "telegramSendSilently" boolean, "pgpKey" varchar, "locale" varchar NOT NULL DEFAULT (''), "pushbulletAccessToken" varchar, "pushoverApplicationToken" varchar, "pushoverUserKey" varchar, "watchlistSyncMovies" boolean, "watchlistSyncTv" boolean, "pushoverSound" varchar, CONSTRAINT "UQ_986a2b6d3c05eb4091bb8066f78" UNIQUE ("userId"), CONSTRAINT "FK_986a2b6d3c05eb4091bb8066f78" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)` + ); + await queryRunner.query( + `INSERT INTO "temporary_user_settings"("id", "notificationTypes", "discordId", "userId", "originalLanguage", "telegramChatId", "telegramSendSilently", "pgpKey", "locale", "pushbulletAccessToken", "pushoverApplicationToken", "pushoverUserKey", "watchlistSyncMovies", "watchlistSyncTv", "pushoverSound") SELECT "id", "notificationTypes", "discordId", "userId", "originalLanguage", "telegramChatId", "telegramSendSilently", "pgpKey", "locale", "pushbulletAccessToken", "pushoverApplicationToken", "pushoverUserKey", "watchlistSyncMovies", "watchlistSyncTv", "pushoverSound" FROM "user_settings"` + ); + await queryRunner.query(`DROP TABLE "user_settings"`); + await queryRunner.query( + `ALTER TABLE "temporary_user_settings" RENAME TO "user_settings"` + ); + await queryRunner.query( + `CREATE TABLE "temporary_user_settings" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "notificationTypes" text, "discordId" varchar, "userId" integer, "originalLanguage" varchar, "telegramChatId" varchar, "telegramSendSilently" boolean, "pgpKey" varchar, "locale" varchar NOT NULL DEFAULT (''), "pushbulletAccessToken" varchar, "pushoverApplicationToken" varchar, "pushoverUserKey" varchar, "watchlistSyncMovies" boolean, "watchlistSyncTv" boolean, "pushoverSound" varchar, "discoverRegion" varchar, "streamingRegion" varchar, CONSTRAINT "UQ_986a2b6d3c05eb4091bb8066f78" UNIQUE ("userId"), CONSTRAINT "FK_986a2b6d3c05eb4091bb8066f78" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)` + ); + await queryRunner.query( + `INSERT INTO "temporary_user_settings"("id", "notificationTypes", "discordId", "userId", "originalLanguage", "telegramChatId", "telegramSendSilently", "pgpKey", "locale", "pushbulletAccessToken", "pushoverApplicationToken", "pushoverUserKey", "watchlistSyncMovies", "watchlistSyncTv", "pushoverSound") SELECT "id", "notificationTypes", "discordId", "userId", "originalLanguage", "telegramChatId", "telegramSendSilently", "pgpKey", "locale", "pushbulletAccessToken", "pushoverApplicationToken", "pushoverUserKey", "watchlistSyncMovies", "watchlistSyncTv", "pushoverSound" FROM "user_settings"` + ); + await queryRunner.query(`DROP TABLE "user_settings"`); + await queryRunner.query( + `ALTER TABLE "temporary_user_settings" RENAME TO "user_settings"` + ); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "user_settings" RENAME TO "temporary_user_settings"` + ); + await queryRunner.query( + `CREATE TABLE "user_settings" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "notificationTypes" text, "discordId" varchar, "userId" integer, "originalLanguage" varchar, "telegramChatId" varchar, "telegramSendSilently" boolean, "pgpKey" varchar, "locale" varchar NOT NULL DEFAULT (''), "pushbulletAccessToken" varchar, "pushoverApplicationToken" varchar, "pushoverUserKey" varchar, "watchlistSyncMovies" boolean, "watchlistSyncTv" boolean, "pushoverSound" varchar, CONSTRAINT "UQ_986a2b6d3c05eb4091bb8066f78" UNIQUE ("userId"), CONSTRAINT "FK_986a2b6d3c05eb4091bb8066f78" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)` + ); + await queryRunner.query( + `INSERT INTO "user_settings"("id", "notificationTypes", "discordId", "userId", "originalLanguage", "telegramChatId", "telegramSendSilently", "pgpKey", "locale", "pushbulletAccessToken", "pushoverApplicationToken", "pushoverUserKey", "watchlistSyncMovies", "watchlistSyncTv", "pushoverSound") SELECT "id", "notificationTypes", "discordId", "userId", "originalLanguage", "telegramChatId", "telegramSendSilently", "pgpKey", "locale", "pushbulletAccessToken", "pushoverApplicationToken", "pushoverUserKey", "watchlistSyncMovies", "watchlistSyncTv", "pushoverSound" FROM "temporary_user_settings"` + ); + await queryRunner.query(`DROP TABLE "temporary_user_settings"`); + await queryRunner.query( + `ALTER TABLE "user_settings" RENAME TO "temporary_user_settings"` + ); + await queryRunner.query( + `CREATE TABLE "user_settings" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "notificationTypes" text, "discordId" varchar, "userId" integer, "originalLanguage" varchar, "telegramChatId" varchar, "telegramSendSilently" boolean, "pgpKey" varchar, "locale" varchar NOT NULL DEFAULT (''), "pushbulletAccessToken" varchar, "pushoverApplicationToken" varchar, "pushoverUserKey" varchar, "watchlistSyncMovies" boolean, "watchlistSyncTv" boolean, "pushoverSound" varchar, "region" varchar, CONSTRAINT "UQ_986a2b6d3c05eb4091bb8066f78" UNIQUE ("userId"), CONSTRAINT "FK_986a2b6d3c05eb4091bb8066f78" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)` + ); + await queryRunner.query( + `INSERT INTO "user_settings"("id", "notificationTypes", "discordId", "userId", "originalLanguage", "telegramChatId", "telegramSendSilently", "pgpKey", "locale", "pushbulletAccessToken", "pushoverApplicationToken", "pushoverUserKey", "watchlistSyncMovies", "watchlistSyncTv", "pushoverSound") SELECT "id", "notificationTypes", "discordId", "userId", "originalLanguage", "telegramChatId", "telegramSendSilently", "pgpKey", "locale", "pushbulletAccessToken", "pushoverApplicationToken", "pushoverUserKey", "watchlistSyncMovies", "watchlistSyncTv", "pushoverSound" FROM "temporary_user_settings"` + ); + await queryRunner.query(`DROP TABLE "temporary_user_settings"`); + } +} diff --git a/server/routes/discover.ts b/server/routes/discover.ts index 55a844ad2..05947cd03 100644 --- a/server/routes/discover.ts +++ b/server/routes/discover.ts @@ -29,12 +29,12 @@ import { z } from 'zod'; export const createTmdbWithRegionLanguage = (user?: User): TheMovieDb => { const settings = getSettings(); - const region = - user?.settings?.region === 'all' + const discoverRegion = + user?.settings?.streamingRegion === 'all' ? '' - : user?.settings?.region - ? user?.settings?.region - : settings.main.region; + : user?.settings?.streamingRegion + ? user?.settings?.streamingRegion + : settings.main.discoverRegion; const originalLanguage = user?.settings?.originalLanguage === 'all' @@ -44,7 +44,7 @@ export const createTmdbWithRegionLanguage = (user?: User): TheMovieDb => { : settings.main.originalLanguage; return new TheMovieDb({ - region, + discoverRegion, originalLanguage, }); }; diff --git a/server/routes/user/usersettings.ts b/server/routes/user/usersettings.ts index 11cbd666f..2e138f7e6 100644 --- a/server/routes/user/usersettings.ts +++ b/server/routes/user/usersettings.ts @@ -56,7 +56,8 @@ userSettingsRoutes.get<{ id: string }, UserSettingsGeneralResponse>( email: user.email, discordId: user.settings?.discordId, locale: user.settings?.locale, - region: user.settings?.region, + discoverRegion: user.settings?.discoverRegion, + streamingRegion: user.settings?.streamingRegion, originalLanguage: user.settings?.originalLanguage, movieQuotaLimit: user.movieQuotaLimit, movieQuotaDays: user.movieQuotaDays, @@ -128,7 +129,8 @@ userSettingsRoutes.post< user: req.user, discordId: req.body.discordId, locale: req.body.locale, - region: req.body.region, + discoverRegion: req.body.discoverRegion, + streamingRegion: req.body.streamingRegion, originalLanguage: req.body.originalLanguage, watchlistSyncMovies: req.body.watchlistSyncMovies, watchlistSyncTv: req.body.watchlistSyncTv, @@ -136,7 +138,8 @@ userSettingsRoutes.post< } else { user.settings.discordId = req.body.discordId; user.settings.locale = req.body.locale; - user.settings.region = req.body.region; + user.settings.discoverRegion = req.body.discoverRegion; + user.settings.streamingRegion = req.body.streamingRegion; user.settings.originalLanguage = req.body.originalLanguage; user.settings.watchlistSyncMovies = req.body.watchlistSyncMovies; user.settings.watchlistSyncTv = req.body.watchlistSyncTv; @@ -148,7 +151,8 @@ userSettingsRoutes.post< username: savedUser.username, discordId: savedUser.settings?.discordId, locale: savedUser.settings?.locale, - region: savedUser.settings?.region, + discoverRegion: savedUser.settings?.discoverRegion, + streamingRegion: savedUser.settings?.streamingRegion, originalLanguage: savedUser.settings?.originalLanguage, watchlistSyncMovies: savedUser.settings?.watchlistSyncMovies, watchlistSyncTv: savedUser.settings?.watchlistSyncTv, diff --git a/src/components/MovieDetails/index.tsx b/src/components/MovieDetails/index.tsx index 9a4b50531..0b9a3b7ad 100644 --- a/src/components/MovieDetails/index.tsx +++ b/src/components/MovieDetails/index.tsx @@ -222,14 +222,14 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => { }); } - const region = user?.settings?.region - ? user.settings.region - : settings.currentSettings.region - ? settings.currentSettings.region + const discoverRegion = user?.settings?.discoverRegion + ? user.settings.discoverRegion + : settings.currentSettings.discoverRegion + ? settings.currentSettings.discoverRegion : 'US'; const releases = data.releases.results.find( - (r) => r.iso_3166_1 === region + (r) => r.iso_3166_1 === discoverRegion )?.release_dates; // Release date types: @@ -282,9 +282,15 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => { ); } + const streamingRegion = user?.settings?.streamingRegion + ? user.settings.streamingRegion + : settings.currentSettings.streamingRegion + ? settings.currentSettings.streamingRegion + : 'US'; const streamingProviders = - data?.watchProviders?.find((provider) => provider.iso_3166_1 === region) - ?.flatrate ?? []; + data?.watchProviders?.find( + (provider) => provider.iso_3166_1 === streamingRegion + )?.flatrate ?? []; function getAvalaibleMediaServerName() { if (settings.currentSettings.mediaServerType === MediaServerType.EMBY) { diff --git a/src/components/RegionSelector/index.tsx b/src/components/RegionSelector/index.tsx index 41383053b..989c62efe 100644 --- a/src/components/RegionSelector/index.tsx +++ b/src/components/RegionSelector/index.tsx @@ -21,6 +21,7 @@ interface RegionSelectorProps { isUserSetting?: boolean; disableAll?: boolean; watchProviders?: boolean; + regionType?: 'discover' | 'streaming'; onChange?: (fieldName: string, region: string) => void; } @@ -30,6 +31,7 @@ const RegionSelector = ({ isUserSetting = false, disableAll = false, watchProviders = false, + regionType = 'discover', onChange, }: RegionSelectorProps) => { const { currentSettings } = useSettings(); @@ -63,6 +65,11 @@ const RegionSelector = ({ sortedRegions?.find((region) => region.iso_3166_1 === regionCode)?.name ?? regionCode; + const regionValue = + regionType === 'discover' + ? currentSettings.discoverRegion + : currentSettings.streamingRegion; + useEffect(() => { if (regions && value) { if (value === 'all') { @@ -97,14 +104,12 @@ const RegionSelector = ({ countries.includes(selectedRegion?.iso_3166_1)) || (isUserSetting && !selectedRegion && - currentSettings.region && - countries.includes(currentSettings.region))) && ( + regionValue && + countries.includes(regionValue))) && ( @@ -114,8 +119,8 @@ const RegionSelector = ({ ? regionName(selectedRegion.iso_3166_1) : isUserSetting && selectedRegion?.iso_3166_1 !== 'all' ? intl.formatMessage(messages.regionServerDefault, { - region: currentSettings.region - ? regionName(currentSettings.region) + region: regionValue + ? regionName(regionValue) : intl.formatMessage(messages.regionDefault), }) : intl.formatMessage(messages.regionDefault)} @@ -148,8 +153,8 @@ const RegionSelector = ({ @@ -160,8 +165,8 @@ const RegionSelector = ({ } block truncate`} > {intl.formatMessage(messages.regionServerDefault, { - region: currentSettings.region - ? regionName(currentSettings.region) + region: regionValue + ? regionName(regionValue) : intl.formatMessage(messages.regionDefault), })} diff --git a/src/components/Selector/index.tsx b/src/components/Selector/index.tsx index db959170b..da4d8b578 100644 --- a/src/components/Selector/index.tsx +++ b/src/components/Selector/index.tsx @@ -374,7 +374,11 @@ export const WatchProviderSelector = ({ const { currentSettings } = useSettings(); const [showMore, setShowMore] = useState(false); const [watchRegion, setWatchRegion] = useState( - region ? region : currentSettings.region ? currentSettings.region : 'US' + region + ? region + : currentSettings.discoverRegion + ? currentSettings.discoverRegion + : 'US' ); const [activeProvider, setActiveProvider] = useState( activeProviders ?? [] diff --git a/src/components/Settings/SettingsMain/index.tsx b/src/components/Settings/SettingsMain/index.tsx index 2d1e0219f..9a028e91f 100644 --- a/src/components/Settings/SettingsMain/index.tsx +++ b/src/components/Settings/SettingsMain/index.tsx @@ -31,10 +31,12 @@ const messages = defineMessages('components.Settings.SettingsMain', { apikey: 'API Key', applicationTitle: 'Application Title', applicationurl: 'Application URL', - region: 'Discover Region', - regionTip: 'Filter content by regional availability', + discoverRegion: 'Discover Region', + discoverRegionTip: 'Filter content by regional availability', originallanguage: 'Discover Language', originallanguageTip: 'Filter content by original language', + streamingRegion: 'Streaming Region', + streamingRegionTip: 'Show streaming sites by regional availability', toastApiKeySuccess: 'New API key generated successfully!', toastApiKeyFailure: 'Something went wrong while generating a new API key.', toastSettingsSuccess: 'Settings saved successfully!', @@ -149,8 +151,9 @@ const SettingsMain = () => { csrfProtection: data?.csrfProtection, hideAvailable: data?.hideAvailable, locale: data?.locale ?? 'en', - region: data?.region, + discoverRegion: data?.discoverRegion, originalLanguage: data?.originalLanguage, + streamingRegion: data?.streamingRegion, partialRequestsEnabled: data?.partialRequestsEnabled, trustProxy: data?.trustProxy, cacheImages: data?.cacheImages, @@ -178,7 +181,8 @@ const SettingsMain = () => { csrfProtection: values.csrfProtection, hideAvailable: values.hideAvailable, locale: values.locale, - region: values.region, + discoverRegion: values.discoverRegion, + streamingRegion: values.streamingRegion, originalLanguage: values.originalLanguage, partialRequestsEnabled: values.partialRequestsEnabled, trustProxy: values.trustProxy, @@ -399,17 +403,17 @@ const SettingsMain = () => {
-
+
+ +
+
+ +
+
+
-
+
+ +
+
+ +
+
+
{currentHasPermission(Permission.MANAGE_USERS) && !hasPermission(Permission.MANAGE_USERS) && ( <> diff --git a/src/context/SettingsContext.tsx b/src/context/SettingsContext.tsx index 7be393969..5579940a2 100644 --- a/src/context/SettingsContext.tsx +++ b/src/context/SettingsContext.tsx @@ -16,7 +16,8 @@ const defaultSettings = { localLogin: true, movie4kEnabled: false, series4kEnabled: false, - region: '', + discoverRegion: '', + streamingRegion: '', originalLanguage: '', mediaServerType: MediaServerType.NOT_CONFIGURED, partialRequestsEnabled: true, diff --git a/src/hooks/useUser.ts b/src/hooks/useUser.ts index f1e830066..f60b402c1 100644 --- a/src/hooks/useUser.ts +++ b/src/hooks/useUser.ts @@ -29,7 +29,8 @@ type NotificationAgentTypes = Record; export interface UserSettings { discordId?: string; - region?: string; + discoverRegion?: string; + streamingRegion?: string; originalLanguage?: string; locale?: string; notificationTypes: Partial; diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index 1642872b3..6872a38ae 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -298,7 +298,6 @@ "components.ManageSlideOver.plays": "{playCount, number} {playCount, plural, one {play} other {plays}}", "components.ManageSlideOver.removearr": "Remove from {arr}", "components.ManageSlideOver.removearr4k": "Remove from 4K {arr}", - "components.RequestList.RequestItem.removearr": "Remove from {arr}", "components.ManageSlideOver.tvshow": "series", "components.MediaSlider.ShowMoreCard.seemore": "See More", "components.MovieDetails.MovieCast.fullcast": "Full Cast", @@ -494,6 +493,7 @@ "components.RequestList.RequestItem.modified": "Modified", "components.RequestList.RequestItem.modifieduserdate": "{date} by {user}", "components.RequestList.RequestItem.profileName": "Profile", + "components.RequestList.RequestItem.removearr": "Remove from {arr}", "components.RequestList.RequestItem.requested": "Requested", "components.RequestList.RequestItem.requesteddate": "Requested", "components.RequestList.RequestItem.seasons": "{seasonCount, plural, one {Season} other {Seasons}}", @@ -877,6 +877,8 @@ "components.Settings.SettingsMain.csrfProtection": "Enable CSRF Protection", "components.Settings.SettingsMain.csrfProtectionHoverTip": "Do NOT enable this setting unless you understand what you are doing!", "components.Settings.SettingsMain.csrfProtectionTip": "Set external API access to read-only (requires HTTPS)", + "components.Settings.SettingsMain.discoverRegion": "Discover Region", + "components.Settings.SettingsMain.discoverRegionTip": "Filter content by regional availability", "components.Settings.SettingsMain.general": "General", "components.Settings.SettingsMain.generalsettings": "General Settings", "components.Settings.SettingsMain.generalsettingsDescription": "Configure global and default settings for Jellyseerr.", @@ -885,8 +887,17 @@ "components.Settings.SettingsMain.originallanguage": "Discover Language", "components.Settings.SettingsMain.originallanguageTip": "Filter content by original language", "components.Settings.SettingsMain.partialRequestsEnabled": "Allow Partial Series Requests", - "components.Settings.SettingsMain.region": "Discover Region", - "components.Settings.SettingsMain.regionTip": "Filter content by regional availability", + "components.Settings.SettingsMain.proxyBypassFilter": "Proxy Ignored Addresses", + "components.Settings.SettingsMain.proxyBypassFilterTip": "Use ',' as a separator, and '*.' as a wildcard for subdomains", + "components.Settings.SettingsMain.proxyBypassLocalAddresses": "Bypass Proxy for Local Addresses", + "components.Settings.SettingsMain.proxyEnabled": "HTTP(S) Proxy", + "components.Settings.SettingsMain.proxyHostname": "Proxy Hostname", + "components.Settings.SettingsMain.proxyPassword": "Proxy Password", + "components.Settings.SettingsMain.proxyPort": "Proxy Port", + "components.Settings.SettingsMain.proxySsl": "Use SSL For Proxy", + "components.Settings.SettingsMain.proxyUser": "Proxy Username", + "components.Settings.SettingsMain.streamingRegion": "Streaming Region", + "components.Settings.SettingsMain.streamingRegionTip": "Show streaming sites by regional availability", "components.Settings.SettingsMain.toastApiKeyFailure": "Something went wrong while generating a new API key.", "components.Settings.SettingsMain.toastApiKeySuccess": "New API key generated successfully!", "components.Settings.SettingsMain.toastSettingsFailure": "Something went wrong while saving settings.", @@ -896,6 +907,7 @@ "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", + "components.Settings.SettingsMain.validationProxyPort": "You must provide a valid port", "components.Settings.SettingsUsers.defaultPermissions": "Default Permissions", "components.Settings.SettingsUsers.defaultPermissionsTip": "Initial permissions assigned to new users", "components.Settings.SettingsUsers.localLogin": "Enable Local Sign-In", @@ -1210,6 +1222,8 @@ "components.UserProfile.UserSettings.UserGeneralSettings.applanguage": "Display Language", "components.UserProfile.UserSettings.UserGeneralSettings.discordId": "Discord User ID", "components.UserProfile.UserSettings.UserGeneralSettings.discordIdTip": "The multi-digit ID number associated with your Discord user account", + "components.UserProfile.UserSettings.UserGeneralSettings.discoverRegion": "Discover Region", + "components.UserProfile.UserSettings.UserGeneralSettings.discoverRegionTip": "Filter content by regional availability", "components.UserProfile.UserSettings.UserGeneralSettings.displayName": "Display Name", "components.UserProfile.UserSettings.UserGeneralSettings.email": "Email", "components.UserProfile.UserSettings.UserGeneralSettings.enableOverride": "Override Global Limit", @@ -1227,12 +1241,12 @@ "components.UserProfile.UserSettings.UserGeneralSettings.plexwatchlistsyncmoviestip": "Automatically request movies on your Plex Watchlist", "components.UserProfile.UserSettings.UserGeneralSettings.plexwatchlistsyncseries": "Auto-Request Series", "components.UserProfile.UserSettings.UserGeneralSettings.plexwatchlistsyncseriestip": "Automatically request series on your Plex Watchlist", - "components.UserProfile.UserSettings.UserGeneralSettings.region": "Discover Region", - "components.UserProfile.UserSettings.UserGeneralSettings.regionTip": "Filter content by regional availability", "components.UserProfile.UserSettings.UserGeneralSettings.role": "Role", "components.UserProfile.UserSettings.UserGeneralSettings.save": "Save Changes", "components.UserProfile.UserSettings.UserGeneralSettings.saving": "Saving…", "components.UserProfile.UserSettings.UserGeneralSettings.seriesrequestlimit": "Series Request Limit", + "components.UserProfile.UserSettings.UserGeneralSettings.streamingRegion": "Streaming Region", + "components.UserProfile.UserSettings.UserGeneralSettings.streamingRegionTip": "Show streaming sites by regional availability", "components.UserProfile.UserSettings.UserGeneralSettings.toastSettingsFailure": "Something went wrong while saving settings.", "components.UserProfile.UserSettings.UserGeneralSettings.toastSettingsFailureEmail": "This email is already taken!", "components.UserProfile.UserSettings.UserGeneralSettings.toastSettingsSuccess": "Settings saved successfully!", @@ -1382,4 +1396,4 @@ "pages.returnHome": "Return Home", "pages.serviceunavailable": "Service Unavailable", "pages.somethingwentwrong": "Something Went Wrong" -} +} \ No newline at end of file diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index e5704052d..d12b91918 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -192,7 +192,8 @@ CoreApp.getInitialProps = async (initialProps) => { movie4kEnabled: false, series4kEnabled: false, localLogin: true, - region: '', + discoverRegion: '', + streamingRegion: '', originalLanguage: '', mediaServerType: MediaServerType.NOT_CONFIGURED, partialRequestsEnabled: true,