Skip to content

Commit

Permalink
code style and fixed extra genres
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonzorn committed May 10, 2024
1 parent f9297b9 commit 536c9b1
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions nlightreader/parsers/combined/shikimori/shikimori_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,26 @@ def get_character(self, character: Character) -> Character:
return character

def get_preview(self, manga: Manga):
return get_html(f"{self.url}/system/mangas/preview/{manga.content_id}.jpg", content_type="content")
return get_html(
f"{self.url}/system/mangas/preview/{manga.content_id}.jpg",
content_type="content",
)

def get_character_preview(self, character: Character):
return get_html(f"{self.url}/system/characters/preview/{character.content_id}.jpg").content
return get_html(
f"{self.url}/system/characters/preview/{character.content_id}.jpg",
content_type="content",
)

def get_genres(self):
url = f"{self.url_api}/genres"
response = get_html(url, headers=self.headers, content_type="json")
if response:
return [Genre(str(i.get("id")), self.CATALOG_ID, i.get("name"), i.get("russian")) for i in response]
return [
Genre(
str(i["id"]), self.CATALOG_ID, i["name"], i["russian"],
) for i in response if i["entry_type"] == "Manga"
]
return []

def get_orders(self) -> list[Order]:
Expand Down

0 comments on commit 536c9b1

Please sign in to comment.