diff --git a/apps/web/next-env.d.ts b/apps/web/next-env.d.ts
index 9edff1c7c..c4b7818fb 100644
--- a/apps/web/next-env.d.ts
+++ b/apps/web/next-env.d.ts
@@ -1,6 +1,6 @@
///
///
-import "./.next/types/routes.d.ts";
+import "./.next/dev/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
diff --git a/apps/web/src/components/where-to-watch/where-to-watch.tsx b/apps/web/src/components/where-to-watch/where-to-watch.tsx
index f14130a38..c63928434 100644
--- a/apps/web/src/components/where-to-watch/where-to-watch.tsx
+++ b/apps/web/src/components/where-to-watch/where-to-watch.tsx
@@ -1,6 +1,8 @@
import type { Buy, Language, Rent } from '@plotwist_app/tmdb'
import { X } from 'lucide-react'
import Image from 'next/image'
+import { getUserPreferences } from '@/api/users'
+import { verifySession } from '@/app/lib/dal'
import { tmdb } from '@/services/tmdb'
import { getDictionary } from '@/utils/dictionaries'
import { tmdbImage } from '@/utils/tmdb/image'
@@ -19,18 +21,18 @@ export async function WhereToWatch({
const { results } = await tmdb.watchProviders.item(variant, id)
const dictionary = await getDictionary(language)
- const resultsByLanguage = {
- 'de-DE': results.DE,
- 'en-US': results.US,
- 'es-ES': results.ES,
- 'fr-FR': results.FR,
- 'it-IT': results.IT,
- 'ja-JP': results.JP,
- 'pt-BR': results.BR,
+ const session = await verifySession()
+ let userWatchRegion: string | null = null
+
+ if (session) {
+ const { data } = await getUserPreferences()
+ userWatchRegion = data?.userPreferences?.watchRegion ?? null
}
+ const region = userWatchRegion ?? language.split('-')[1]
const watchProvider =
- resultsByLanguage[language] ?? resultsByLanguage['en-US']
+ results[region as keyof typeof results] ??
+ results[language.split('-')[1] as keyof typeof results]
return (