diff --git a/minoshiro/web_api/ani_list.py b/minoshiro/web_api/ani_list.py index 6fa355c..d100ce4 100644 --- a/minoshiro/web_api/ani_list.py +++ b/minoshiro/web_api/ani_list.py @@ -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 @@ -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})''' diff --git a/minoshiro/web_api/anime_planet.py b/minoshiro/web_api/anime_planet.py index 6c2e535..d9b8e07 100644 --- a/minoshiro/web_api/anime_planet.py +++ b/minoshiro/web_api/anime_planet.py @@ -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: @@ -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: diff --git a/minoshiro/web_api/kitsu.py b/minoshiro/web_api/kitsu.py index 0ef53e0..c74f6cd 100644 --- a/minoshiro/web_api/kitsu.py +++ b/minoshiro/web_api/kitsu.py @@ -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 diff --git a/minoshiro/web_api/lndb.py b/minoshiro/web_api/lndb.py index 7b4a158..cff26fe 100644 --- a/minoshiro/web_api/lndb.py +++ b/minoshiro/web_api/lndb.py @@ -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: diff --git a/minoshiro/web_api/mu.py b/minoshiro/web_api/mu.py index a7858c7..8bb8236 100644 --- a/minoshiro/web_api/mu.py +++ b/minoshiro/web_api/mu.py @@ -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: diff --git a/minoshiro/web_api/nu.py b/minoshiro/web_api/nu.py index f01b2a7..a977a5e 100644 --- a/minoshiro/web_api/nu.py +++ b/minoshiro/web_api/nu.py @@ -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: