mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
chg: lint: format code
This commit is contained in:
parent
4be2812780
commit
60410481c1
@ -102,7 +102,8 @@ class TheMovieDatabase(Provider):
|
||||
|
||||
def merge_translations(self, host, translations, *, languages: list[Language]):
|
||||
host.translations = {
|
||||
k.to_tag(): v.translations[k.to_tag()] for k, v in zip(languages, translations)
|
||||
k.to_tag(): v.translations[k.to_tag()]
|
||||
for k, v in zip(languages, translations)
|
||||
}
|
||||
return host
|
||||
|
||||
@ -202,9 +203,13 @@ class TheMovieDatabase(Provider):
|
||||
if len(search_results) == 0:
|
||||
raise ProviderError(f"No result for a movie named: {name}")
|
||||
search = self.get_best_result(search_results, name, year)
|
||||
return await self.identify_movie(search["id"], original_language=search["original_language"])
|
||||
return await self.identify_movie(
|
||||
search["id"], original_language=search["original_language"]
|
||||
)
|
||||
|
||||
async def identify_movie(self, movie_id: str, original_language: Optional[str] = "null") -> Movie:
|
||||
async def identify_movie(
|
||||
self, movie_id: str, original_language: Optional[str] = "null"
|
||||
) -> Movie:
|
||||
languages = self.get_languages()
|
||||
|
||||
async def for_language(lng: Language) -> Movie:
|
||||
|
@ -13,6 +13,7 @@ if TYPE_CHECKING:
|
||||
from providers.types.episode import Episode
|
||||
from providers.types.collection import Collection
|
||||
|
||||
|
||||
def format_date(date: date | int | None) -> str | None:
|
||||
if date is None:
|
||||
return None
|
||||
@ -27,7 +28,9 @@ def normalize_lang(lang: str) -> str:
|
||||
|
||||
# For now, the API of kyoo only support one language so we remove the others.
|
||||
default_languages = os.environ.get("LIBRARY_LANGUAGES", "").split(",")
|
||||
media_prefer_original_language = os.environ.get("MEDIA_PREFER_ORIGINAL_LANGUAGE", "false").lower() == "true"
|
||||
media_prefer_original_language = (
|
||||
os.environ.get("MEDIA_PREFER_ORIGINAL_LANGUAGE", "false").lower() == "true"
|
||||
)
|
||||
|
||||
|
||||
def sort_translations(
|
||||
@ -64,7 +67,9 @@ def select_image(
|
||||
chain(
|
||||
*(
|
||||
getattr(trans, kind)
|
||||
for trans in sort_translations(value, prefer_orginal=media_prefer_original_language)
|
||||
for trans in sort_translations(
|
||||
value, prefer_orginal=media_prefer_original_language
|
||||
)
|
||||
)
|
||||
),
|
||||
None,
|
||||
|
Loading…
x
Reference in New Issue
Block a user