From 28a3db7e88337f181a27187903715e259aef7710 Mon Sep 17 00:00:00 2001 From: stabbedbybrick <125766685+stabbedbybrick@users.noreply.github.com> Date: Fri, 24 May 2024 08:26:07 +0200 Subject: [PATCH] fix(DSCP): Fix fallback user language Use the language tags from user client info if audio tracks are not listed on API --- services/DSCP/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/DSCP/__init__.py b/services/DSCP/__init__.py index d6ddab9..cf937dd 100644 --- a/services/DSCP/__init__.py +++ b/services/DSCP/__init__.py @@ -124,7 +124,7 @@ class DSCP(Service): name=ep["attributes"]["name"], language=ep["attributes"]["audioTracks"][0] if ep["attributes"].get("audioTracks") - else self.territory, + else self.user_language, data=ep, ) for episodes in videos @@ -317,5 +317,6 @@ class DSCP(Service): user = self.session.get(self.config["endpoints"]["user"].format(region=self.region)).json() self.territory = user["data"]["attributes"]["currentLocationTerritory"] + self.user_language = user["data"]["attributes"]["clientTranslationLanguageTags"][0] self.site_id = user["meta"]["site"]["id"]