Skip to content

Commit

Permalink
Simplify code following review
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Mar 25, 2024
1 parent dde529e commit 1ab9caf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ted2zim/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ def sort_languages_hack(languages: set[str]) -> list[str]:
For now, if eng is among the list, we assume it is the most important
language. Otherwise list is kept as-is
"""
if "eng" in languages:
return ["eng", *[lang for lang in languages if lang != "eng"]]
return list(languages)
return list(languages).sort(
key=lambda x: -1 if x == "eng" else 0
) # pyright: ignore[reportReturnType]

if len(self.languages) == 0:
if not self.languages:
self.zim_languages = "eng"
else:
self.zim_languages = ",".join(
Expand Down

0 comments on commit 1ab9caf

Please sign in to comment.