Use image selection logic for trailers (#497)

This commit is contained in:
Zoe Roux 2024-05-15 00:28:13 +02:00 committed by GitHub
parent c249816808
commit 299b3e2328
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -58,7 +58,7 @@ class Movie:
"poster": select_image(self, "posters"), "poster": select_image(self, "posters"),
"thumbnail": select_image(self, "thumbnails"), "thumbnail": select_image(self, "thumbnails"),
"logo": select_image(self, "logos"), "logo": select_image(self, "logos"),
"trailer": next(iter(trans.trailers), None), "trailer": select_image(self, "trailers"),
"studio": next((x.to_kyoo() for x in self.studios), None), "studio": next((x.to_kyoo() for x in self.studios), None),
"genres": [x.to_kyoo() for x in self.genres], "genres": [x.to_kyoo() for x in self.genres],
"collections": None, "collections": None,

View File

@ -61,7 +61,7 @@ class Show:
"poster": select_image(self, "posters"), "poster": select_image(self, "posters"),
"thumbnail": select_image(self, "thumbnails"), "thumbnail": select_image(self, "thumbnails"),
"logo": select_image(self, "logos"), "logo": select_image(self, "logos"),
"trailer": next(iter(trans.trailers), None), "trailer": select_image(self, "trailers"),
"genres": [x.to_kyoo() for x in self.genres], "genres": [x.to_kyoo() for x in self.genres],
"file_title": None, "file_title": None,
} }

View File

@ -58,7 +58,7 @@ def select_translation(
def select_image( def select_image(
value: Movie | Show | Season | Collection, value: Movie | Show | Season | Collection,
kind: Literal["posters"] | Literal["thumbnails"] | Literal["logos"], kind: Literal["posters", "thumbnails", "logos", "trailers"],
) -> str | None: ) -> str | None:
return next( return next(
chain( chain(