From 694cb78947bd170f9f30f327c299bec06cd1dbd7 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Fri, 22 Aug 2025 14:25:23 -0400 Subject: [PATCH] Fix error loading feed when device language is Australian English (`en_AU`) --- CHANGELOG.md | 4 +++- playlet-lib/src/components/Services/Innertube/Context.bs | 6 +++--- .../Web/PlayletWebServer/Middleware/StateApiRouter.bs | 7 +------ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0fd535f..70f25ea3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing worth mentioning yet +### Fixed + +- Error loading feed when device language is Australian English (`en_AU`) ## [0.40.13] - 2025-08-19 diff --git a/playlet-lib/src/components/Services/Innertube/Context.bs b/playlet-lib/src/components/Services/Innertube/Context.bs index 85ab96b5..7b89ebf6 100644 --- a/playlet-lib/src/components/Services/Innertube/Context.bs +++ b/playlet-lib/src/components/Services/Innertube/Context.bs @@ -182,9 +182,9 @@ namespace Innertube function GetCurrentLocale(deviceInfo as object) as string currentLocale = deviceInfo.GetCurrentLocale() - ' en_CA is not a valid locale for Innertube - if currentLocale = "en_CA" - currentLocale = "en_US" + ' en_CA and en_AU are not valid locales for Innertube + if currentLocale = "en_CA" or currentLocale = "en_AU" + return "en_US" end if return currentLocale end function diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/StateApiRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/StateApiRouter.bs index 8a07bfdd..1b64deef 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/StateApiRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/StateApiRouter.bs @@ -54,12 +54,7 @@ namespace Http end if if keysDict["device"] = true - deviceInfo = m.applicationInfoNode@.GetDeviceInfo() - ' We do not currently have translations for en_CA - if deviceInfo.current_locale = "en_CA" - deviceInfo.current_locale = "en_US" - end if - state["device"] = deviceInfo + state["device"] = m.applicationInfoNode@.GetDeviceInfo() end if if keysDict["invidious"] = true