diff --git a/fastanime/cli/__init__.py b/fastanime/cli/__init__.py index 9ad771c..29e88c6 100644 --- a/fastanime/cli/__init__.py +++ b/fastanime/cli/__init__.py @@ -60,7 +60,7 @@ signal.signal(signal.SIGINT, handle_exit) fastanime --icons --default anilist \b # viewing manga - fastanime --manga search -t + fastanime --manga search -t """, ) @click.version_option(__version__, "--version") @@ -142,7 +142,7 @@ signal.signal(signal.SIGINT, handle_exit) @click.option( "--normalize-titles/--no-normalize-titles", type=bool, - help="whether to normalize anime and episode titls given by providers", + help="whether to normalize anime and episode titles given by providers", ) @click.option("-d", "--downloads-dir", type=click.Path(), help="Downloads location") @click.option("--fzf", is_flag=True, help="Use fzf for the ui") diff --git a/fastanime/cli/commands/anilist/login.py b/fastanime/cli/commands/anilist/login.py index d2d68d2..c6c4319 100644 --- a/fastanime/cli/commands/anilist/login.py +++ b/fastanime/cli/commands/anilist/login.py @@ -19,7 +19,7 @@ def login(config: "Config", status, erase): if status: is_logged_in = True if config.user else False message = ( - "You are logged in :smile:" if is_logged_in else "You arent logged in :cry:" + "You are logged in :smile:" if is_logged_in else "You aren't logged in :cry:" ) print(message) print(config.user) diff --git a/fastanime/cli/commands/anilist/random_anime.py b/fastanime/cli/commands/anilist/random_anime.py index 5fdd47f..209b781 100644 --- a/fastanime/cli/commands/anilist/random_anime.py +++ b/fastanime/cli/commands/anilist/random_anime.py @@ -2,7 +2,7 @@ import click @click.command( - help="Get random anime from anilist based on a range of anilist anime ids that are seected at random", + help="Get random anime from anilist based on a range of anilist anime ids that are selected at random", short_help="View random anime", ) @click.option( diff --git a/fastanime/cli/commands/anilist/upcoming.py b/fastanime/cli/commands/anilist/upcoming.py index 8472e48..65ef8df 100644 --- a/fastanime/cli/commands/anilist/upcoming.py +++ b/fastanime/cli/commands/anilist/upcoming.py @@ -2,7 +2,7 @@ import click @click.command( - help="Fetch the 15 most anticipited anime", short_help="View upcoming anime" + help="Fetch the 15 most anticipated anime", short_help="View upcoming anime" ) @click.option( "--dump-json", diff --git a/fastanime/cli/completion_functions.py b/fastanime/cli/completion_functions.py index 358ec96..65affc9 100644 --- a/fastanime/cli/completion_functions.py +++ b/fastanime/cli/completion_functions.py @@ -59,7 +59,7 @@ def get_anime_titles(query: str, variables: dict = {}): else: return [] except Exception as e: - logger.error(f"Something unexpected occured {e}") + logger.error(f"Something unexpected occurred {e}") return [] diff --git a/fastanime/cli/interfaces/utils.py b/fastanime/cli/interfaces/utils.py index ca93bb1..7b23430 100644 --- a/fastanime/cli/interfaces/utils.py +++ b/fastanime/cli/interfaces/utils.py @@ -96,7 +96,7 @@ def write_search_results( titles: list[str], workers: int | None = None, ): - """A helper function used by and run in a background thread by get_fzf_preview function inorder to get the actual preview data to be displayed by fzf + """A helper function used by and run in a background thread by get_fzf_preview function in order to get the actual preview data to be displayed by fzf Args: anilist_results: the anilist results from an anilist action @@ -122,7 +122,7 @@ def write_search_results( # handle the text data template = f""" ll=2 - while [ $ll -le $FZF_PREVIEW_COLUMNS ];do + while [ $ll -le $FZF_PREVIEW_COLUMNS ];do echo -n -e "{get_true_fg("─",*SEPARATOR_COLOR,bold=False)}" ((ll++)) done @@ -130,7 +130,7 @@ def write_search_results( echo "{get_true_fg('Title(jp):',*HEADER_COLOR)} {(anime['title']['romaji'] or "").replace('"',SINGLE_QUOTE)}" echo "{get_true_fg('Title(eng):',*HEADER_COLOR)} {(anime['title']['english'] or "").replace('"',SINGLE_QUOTE)}" ll=2 - while [ $ll -le $FZF_PREVIEW_COLUMNS ];do + while [ $ll -le $FZF_PREVIEW_COLUMNS ];do echo -n -e "{get_true_fg("─",*SEPARATOR_COLOR,bold=False)}" ((ll++)) done @@ -141,7 +141,7 @@ def write_search_results( echo "{get_true_fg('Next Episode:',*HEADER_COLOR)} {anilist_data_helper.extract_next_airing_episode(anime['nextAiringEpisode']).replace('"',SINGLE_QUOTE)}" echo "{get_true_fg('Genres:',*HEADER_COLOR)} {anilist_data_helper.format_list_data_with_comma(anime['genres']).replace('"',SINGLE_QUOTE)}" ll=2 - while [ $ll -le $FZF_PREVIEW_COLUMNS ];do + while [ $ll -le $FZF_PREVIEW_COLUMNS ];do echo -n -e "{get_true_fg("─",*SEPARATOR_COLOR,bold=False)}" ((ll++)) done @@ -150,7 +150,7 @@ def write_search_results( echo "{get_true_fg('Start Date:',*HEADER_COLOR)} {anilist_data_helper.format_anilist_date_object(anime['startDate']).replace('"',SINGLE_QUOTE)}" echo "{get_true_fg('End Date:',*HEADER_COLOR)} {anilist_data_helper.format_anilist_date_object(anime['endDate']).replace('"',SINGLE_QUOTE)}" ll=2 - while [ $ll -le $FZF_PREVIEW_COLUMNS ];do + while [ $ll -le $FZF_PREVIEW_COLUMNS ];do echo -n -e "{get_true_fg("─",*SEPARATOR_COLOR,bold=False)}" ((ll++)) done @@ -158,7 +158,7 @@ def write_search_results( echo "{get_true_fg('Media List:',*HEADER_COLOR)} {mediaListName.replace('"',SINGLE_QUOTE)}" echo "{get_true_fg('Progress:',*HEADER_COLOR)} {progress}" ll=2 - while [ $ll -le $FZF_PREVIEW_COLUMNS ];do + while [ $ll -le $FZF_PREVIEW_COLUMNS ];do echo -n -e "{get_true_fg("─",*SEPARATOR_COLOR,bold=False)}" ((ll++)) done @@ -305,7 +305,7 @@ def get_fzf_episode_preview( template = textwrap.dedent( f""" ll=2 - while [ $ll -le $FZF_PREVIEW_COLUMNS ];do + while [ $ll -le $FZF_PREVIEW_COLUMNS ];do echo -n -e "{get_true_fg("─",*SEPARATOR_COLOR,bold=False)}" ((ll++)) done @@ -313,13 +313,13 @@ def get_fzf_episode_preview( echo "{get_true_fg('Anime Title(jp):',*HEADER_COLOR)} {(anilist_result['title']['romaji'] or '').replace('"',SINGLE_QUOTE)}" ll=2 - while [ $ll -le $FZF_PREVIEW_COLUMNS ];do + while [ $ll -le $FZF_PREVIEW_COLUMNS ];do echo -n -e "{get_true_fg("─",*SEPARATOR_COLOR,bold=False)}" ((ll++)) done echo "{str(episode_title).replace('"',SINGLE_QUOTE)}" ll=2 - while [ $ll -le $FZF_PREVIEW_COLUMNS ];do + while [ $ll -le $FZF_PREVIEW_COLUMNS ];do echo -n -e "{get_true_fg("─",*SEPARATOR_COLOR,bold=False)}" ((ll++)) done @@ -352,15 +352,15 @@ def get_fzf_episode_preview( title={} show_image_previews="%s" dim=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES} - if [ $show_image_previews = "true" ];then - if [ -s "%s\\\\\\${title}.png" ]; then + if [ $show_image_previews = "true" ];then + if [ -s "%s\\\\\\${title}.png" ]; then if command -v "chafa">/dev/null;then chafa -s $dim "%s\\\\\\${title}.png" else echo please install chafa to enjoy image previews fi - echo - else + echo + else echo Loading... fi fi @@ -380,7 +380,7 @@ def get_fzf_episode_preview( title={} %s show_image_previews="%s" - if [ $show_image_previews = "true" ];then + if [ $show_image_previews = "true" ];then if [ -s %s/${title}.png ]; then fzf-preview %s/${title}.png else echo Loading... fi @@ -431,14 +431,14 @@ def get_fzf_anime_preview( show_image_previews="%s" dim=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES} if [ $show_image_previews = "true" ];then - if [ -s "%s\\\\\\${title}.png" ]; then + if [ -s "%s\\\\\\${title}.png" ]; then if command -v "chafa">/dev/null;then chafa -s $dim "%s\\\\\\${title}.png" else echo please install chafa to enjoy image previews fi - echo - else + echo + else echo Loading... fi fi diff --git a/fastanime/cli/utils/print_img.py b/fastanime/cli/utils/print_img.py index e2f5879..f3c78d4 100644 --- a/fastanime/cli/utils/print_img.py +++ b/fastanime/cli/utils/print_img.py @@ -5,7 +5,7 @@ import requests def print_img(url: str): - """helper funtion to print an image given its url + """helper function to print an image given its url Args: url: [TODO:description] @@ -25,7 +25,7 @@ def print_img(url: str): return img_bytes = res.content """ - Change made in call to chafa. Chafa dev dropped abilty + Change made in call to chafa. Chafa dev dropped ability to pull from urls. Keeping old line here just in case. subprocess.run([EXECUTABLE, url, "--size=15x15"], input=img_bytes) diff --git a/fastanime/cli/utils/utils.py b/fastanime/cli/utils/utils.py index 86c34fe..1e96c8f 100644 --- a/fastanime/cli/utils/utils.py +++ b/fastanime/cli/utils/utils.py @@ -92,7 +92,7 @@ def filter_by_quality(quality: str, stream_links: "list[EpisodeStream]", default def format_bytes_to_human(num_of_bytes: float, suffix: str = "B"): - """Helper function usedd to format bytes to human + """Helper function used to format bytes to human Args: num_of_bytes: the number of bytes to format diff --git a/fastanime/libs/anilist/api.py b/fastanime/libs/anilist/api.py index 1cf0651..0abc350 100644 --- a/fastanime/libs/anilist/api.py +++ b/fastanime/libs/anilist/api.py @@ -64,7 +64,7 @@ class AniListApi: self.session = requests.session() def login_user(self, token: str): - """methosd used to login a new user enabling authenticated requests + """method used to login a new user enabling authenticated requests Args: token: anilist app token @@ -247,7 +247,7 @@ class AniListApi: return (False, None) except Exception as e: - logger.error(f"Something unexpected occured {e}") + logger.error(f"Something unexpected occurred {e}") return (False, None) # type: ignore def get_data( @@ -311,7 +311,7 @@ class AniListApi: }, ) # type: ignore except Exception as e: - logger.error(f"Something unexpected occured {e}") + logger.error(f"Something unexpected occurred {e}") return (False, {"Error": f"{e}"}) # type: ignore def search( @@ -456,7 +456,7 @@ class AniListApi: recommended_anime = self.get_data(recommended_query, variables) return recommended_anime - def get_charcters_of(self, id: int, type="ANIME", *_, **kwargs): + def get_characters_of(self, id: int, type="ANIME", *_, **kwargs): variables = {"id": id} characters = self.get_data(anime_characters_query, variables) return characters diff --git a/fastanime/libs/anilist/queries_graphql.py b/fastanime/libs/anilist/queries_graphql.py index 21e82d3..13eaf10 100644 --- a/fastanime/libs/anilist/queries_graphql.py +++ b/fastanime/libs/anilist/queries_graphql.py @@ -1,5 +1,5 @@ """ -This module contains all the preset queries for the sake of neatness and convinience +This module contains all the preset queries for the sake of neatness and convenience Mostly for internal usage """ @@ -26,7 +26,7 @@ query($id:Int){ } } body - + } } } @@ -88,7 +88,7 @@ query{ large medium } - + } } """ @@ -909,7 +909,7 @@ query ($id: Int,$type:MediaType) { airingAt timeUntilAiring episode - + } } } diff --git a/fastanime/libs/common/mini_anilist.py b/fastanime/libs/common/mini_anilist.py index 2ad069b..dc4f1b4 100644 --- a/fastanime/libs/common/mini_anilist.py +++ b/fastanime/libs/common/mini_anilist.py @@ -246,7 +246,7 @@ def get_mal_id_and_anilist_id(anime_title: str) -> "dict[str,int] | None": ) return {"id_anilist": anime["id"], "id_mal": anime["idMal"]} except Exception as e: - logger.error(f"Something unexpected occured {e}") + logger.error(f"Something unexpected occurred {e}") def get_basic_anime_info_by_title(anime_title: str): @@ -320,4 +320,4 @@ def get_basic_anime_info_by_title(anime_title: str): ], } except Exception as e: - logger.error(f"Something unexpected occured {e}") + logger.error(f"Something unexpected occurred {e}")