fix(DSCP): Fix fallback user language
Use the language tags from user client info if audio tracks are not listed on API
This commit is contained in:
parent
c09ffda359
commit
28a3db7e88
@ -124,7 +124,7 @@ class DSCP(Service):
|
|||||||
name=ep["attributes"]["name"],
|
name=ep["attributes"]["name"],
|
||||||
language=ep["attributes"]["audioTracks"][0]
|
language=ep["attributes"]["audioTracks"][0]
|
||||||
if ep["attributes"].get("audioTracks")
|
if ep["attributes"].get("audioTracks")
|
||||||
else self.territory,
|
else self.user_language,
|
||||||
data=ep,
|
data=ep,
|
||||||
)
|
)
|
||||||
for episodes in videos
|
for episodes in videos
|
||||||
@ -317,5 +317,6 @@ class DSCP(Service):
|
|||||||
|
|
||||||
user = self.session.get(self.config["endpoints"]["user"].format(region=self.region)).json()
|
user = self.session.get(self.config["endpoints"]["user"].format(region=self.region)).json()
|
||||||
self.territory = user["data"]["attributes"]["currentLocationTerritory"]
|
self.territory = user["data"]["attributes"]["currentLocationTerritory"]
|
||||||
|
self.user_language = user["data"]["attributes"]["clientTranslationLanguageTags"][0]
|
||||||
self.site_id = user["meta"]["site"]["id"]
|
self.site_id = user["meta"]["site"]["id"]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user