chg: feat: add localization to collections as well

This commit is contained in:
Felipe Marinho 2024-11-15 11:13:06 -03:00 committed by Zoe Roux
parent eaa09aba3b
commit f121b718a9
No known key found for this signature in database

View File

@ -742,6 +742,8 @@ class TheMovieDatabase(Provider):
f"collection/{provider_id}", f"collection/{provider_id}",
params={ params={
"language": lng.to_tag(), "language": lng.to_tag(),
"append_to_response": "images",
"include_image_language": f"{lng.language},null,en",
}, },
) )
logger.debug("TMDb responded: %s", collection) logger.debug("TMDb responded: %s", collection)
@ -757,13 +759,9 @@ class TheMovieDatabase(Provider):
translation = CollectionTranslation( translation = CollectionTranslation(
name=collection["name"], name=collection["name"],
overview=collection["overview"], overview=collection["overview"],
posters=[ posters=self.get_best_image(collection, lng, "posters"),
f"https://image.tmdb.org/t/p/original{collection['poster_path']}"
],
logos=[], logos=[],
thumbnails=[ thumbnails=self.get_best_image(collection, lng, "backdrops"),
f"https://image.tmdb.org/t/p/original{collection['backdrop_path']}"
],
) )
ret.translations = {lng.to_tag(): translation} ret.translations = {lng.to_tag(): translation}
return ret return ret