Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions minoshiro/web_api/ani_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def match_max(thing: dict, matcher: SequenceMatcher) -> float:
matcher.set_seq1(name.lower())
ratio = matcher.ratio()
if 'one shot' in thing['type'].lower():
ratio = ratio - .05
ratio -= .05
if ratio > max_ratio:
max_ratio = ratio
return max_ratio
Expand Down Expand Up @@ -193,10 +193,7 @@ async def get_page_by_popularity(session_manager, medium: Medium,


def __get_query_string(medium, query, search=False) -> str:
if medium == Medium.ANIME:
med_str = 'ANIME'
else:
med_str = 'MANGA'
med_str = 'ANIME' if medium == Medium.ANIME else 'MANGA'
if search:
full_str = f'''Page (page: 1, perPage: 40) {{
media (search: "{query}" type: {med_str})'''
Expand Down
4 changes: 2 additions & 2 deletions minoshiro/web_api/anime_planet.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def get_anime_url_by_id(anime_id) -> str:

:return: the anime url.
"""
return 'http://www.anime-planet.com/anime/' + str(anime_id)
return f'http://www.anime-planet.com/anime/{anime_id!s}'


def get_manga_url_by_id(manga_id) -> str:
Expand All @@ -145,7 +145,7 @@ def get_manga_url_by_id(manga_id) -> str:

:return: the manga url.
"""
return 'http://www.anime-planet.com/manga/' + str(manga_id)
return f'http://www.anime-planet.com/manga/{manga_id!s}'


def __get_closest(query: str, anime_list: List[dict], names) -> dict:
Expand Down
2 changes: 1 addition & 1 deletion minoshiro/web_api/kitsu.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def match_max(thing: dict, matcher: SequenceMatcher) -> float:
matcher.set_seq1(name.lower())
ratio = matcher.ratio()
if 'one shot' in thing['type'].lower():
ratio = ratio - .05
ratio -= .05
if ratio > max_ratio:
max_ratio = ratio
return max_ratio
Expand Down
2 changes: 1 addition & 1 deletion minoshiro/web_api/lndb.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_light_novel_by_id(ln_id) -> str:

:return: the ln url
"""
return 'http://lndb.info/light_novel/' + str(ln_id)
return f'http://lndb.info/light_novel/{ln_id!s}'


def __get_closest(query: str, ln_list: List[dict], names) -> dict:
Expand Down
2 changes: 1 addition & 1 deletion minoshiro/web_api/mu.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_manga_url_by_id(manga_id) -> str:

:return: the manga url.
"""
return 'https://www.mangaupdates.com/series.html?id=' + str(manga_id)
return f'https://www.mangaupdates.com/series.html?id={manga_id!s}'


def __get_closest(query: str, manga_list: List[dict], names) -> dict:
Expand Down
2 changes: 1 addition & 1 deletion minoshiro/web_api/nu.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_light_novel_by_id(ln_id: str) -> str:

:return: the ln url.
"""
return 'http://novelupdates.com/series/' + str(ln_id)
return f'http://novelupdates.com/series/{ln_id!s}'


def __get_closest(query: str, ln_list: List[dict], names) -> dict:
Expand Down