mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-08 18:54:22 -04:00
chg: fix: modify tmdb request
This commit is contained in:
parent
196f5678df
commit
8f2b487fb4
@ -196,11 +196,13 @@ class TheMovieDatabase(Provider):
|
|||||||
languages = self.get_languages()
|
languages = self.get_languages()
|
||||||
|
|
||||||
async def for_language(lng: str) -> Movie:
|
async def for_language(lng: str) -> Movie:
|
||||||
|
lng_iso639_1 = lng.split("-").pop(0)
|
||||||
movie = await self.get(
|
movie = await self.get(
|
||||||
f"movie/{movie_id}",
|
f"movie/{movie_id}",
|
||||||
params={
|
params={
|
||||||
"language": lng,
|
"language": lng,
|
||||||
"append_to_response": "alternative_titles,videos,credits,keywords,images",
|
"append_to_response": "alternative_titles,videos,credits,keywords,images",
|
||||||
|
"include_image_language": f"{lng},{lng_iso639_1},null",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
logger.debug("TMDb responded: %s", movie)
|
logger.debug("TMDb responded: %s", movie)
|
||||||
@ -250,7 +252,6 @@ class TheMovieDatabase(Provider):
|
|||||||
else [],
|
else [],
|
||||||
# TODO: Add cast information
|
# TODO: Add cast information
|
||||||
)
|
)
|
||||||
lng_iso639_1 = lng.split("-").pop(0)
|
|
||||||
translation = MovieTranslation(
|
translation = MovieTranslation(
|
||||||
name=movie["title"],
|
name=movie["title"],
|
||||||
tagline=movie["tagline"] if movie["tagline"] else None,
|
tagline=movie["tagline"] if movie["tagline"] else None,
|
||||||
@ -290,11 +291,15 @@ class TheMovieDatabase(Provider):
|
|||||||
languages = self.get_languages()
|
languages = self.get_languages()
|
||||||
|
|
||||||
async def for_language(lng: str) -> Show:
|
async def for_language(lng: str) -> Show:
|
||||||
|
# ISO 639-1 (eg. "en") is required as TMDB does not support fetching images
|
||||||
|
# by ISO 639-2 + ISO 3166-1 alpha-2 (eg. "en-US")
|
||||||
|
lng_iso639_1 = lng.split("-").pop(0)
|
||||||
show = await self.get(
|
show = await self.get(
|
||||||
f"tv/{show_id}",
|
f"tv/{show_id}",
|
||||||
params={
|
params={
|
||||||
"language": lng,
|
"language": lng,
|
||||||
"append_to_response": "alternative_titles,videos,credits,keywords,images,external_ids",
|
"append_to_response": "alternative_titles,videos,credits,keywords,images,external_ids",
|
||||||
|
"include_image_language": f"{lng},{lng_iso639_1},null",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
logger.debug("TMDb responded: %s", show)
|
logger.debug("TMDb responded: %s", show)
|
||||||
@ -342,7 +347,6 @@ class TheMovieDatabase(Provider):
|
|||||||
],
|
],
|
||||||
# TODO: Add cast information
|
# TODO: Add cast information
|
||||||
)
|
)
|
||||||
lng_iso639_1 = lng.split("-").pop(0)
|
|
||||||
translation = ShowTranslation(
|
translation = ShowTranslation(
|
||||||
name=show["name"],
|
name=show["name"],
|
||||||
tagline=show["tagline"] if show["tagline"] else None,
|
tagline=show["tagline"] if show["tagline"] else None,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user