diff --git a/CHANGELOG.md b/CHANGELOG.md index b960abd1..d383fc86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- a bug where trending and search wouldn't work in certain countries (web app) + ## [0.23.4] - 2024-05-04 ### Added diff --git a/playlet-web/src/lib/Screens/SearchScreen.svelte b/playlet-web/src/lib/Screens/SearchScreen.svelte index 799b4a37..db33bde1 100644 --- a/playlet-web/src/lib/Screens/SearchScreen.svelte +++ b/playlet-web/src/lib/Screens/SearchScreen.svelte @@ -31,7 +31,11 @@ playletStateStore.subscribe((value) => { invidiousApi.instance = value?.invidious?.current_instance; - invidiousApi.userCountryCode = value?.device?.user_country_code ?? "US"; + let userCountryCode = value?.device?.user_country_code; + if (!userCountryCode || userCountryCode === "OT") { + userCountryCode = "US"; + } + invidiousApi.userCountryCode = userCountryCode; }); searchHistoryStore.subscribe((value) => { diff --git a/playlet-web/src/lib/VideoFeed/VideoListRow.svelte b/playlet-web/src/lib/VideoFeed/VideoListRow.svelte index 29b33de9..da57bfc0 100644 --- a/playlet-web/src/lib/VideoFeed/VideoListRow.svelte +++ b/playlet-web/src/lib/VideoFeed/VideoListRow.svelte @@ -83,7 +83,11 @@ playletStateStore.subscribe((value) => { invidiousApi.instance = value?.invidious?.current_instance; - invidiousApi.userCountryCode = value?.device?.user_country_code ?? "US"; + let userCountryCode = value?.device?.user_country_code; + if (!userCountryCode || userCountryCode === "OT") { + userCountryCode = "US"; + } + invidiousApi.userCountryCode = userCountryCode; invidiousApi.isLoggedIn = !!(value.profiles?.currentProfile ?? false); loadRow(); });