Compare commits

..

7 Commits

Author SHA1 Message Date
Benex254
ab782acf2f chore: bump version 2024-08-18 15:47:44 +03:00
Benex254
45836d1ebc fix: handle no matches for search results 2024-08-18 15:47:29 +03:00
Benex254
dff059d8eb fix: workaround over typing issue 2024-08-18 15:32:13 +03:00
Benex254
4010cfc9c8 fix: correct update command 2024-08-18 15:29:54 +03:00
Benex254
6329730820 chore: bump version 2024-08-18 15:23:39 +03:00
Benex254
006592ae7d test: add grab command tests 2024-08-18 15:23:27 +03:00
Benex254
831dcf4e88 feat: fix python 3.10 incompatibility issue 2024-08-18 15:20:58 +03:00
8 changed files with 25 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ if sys.version_info < (3, 10):
) # noqa: F541
__version__ = "v2.2.4"
__version__ = "v2.2.6"
APP_NAME = "FastAnime"
AUTHOR = "Benex254"

View File

@@ -39,11 +39,11 @@ def check_for_updates():
and remote_tag[1] == local_tag[1]
)
):
is_update = True
is_latest = False
else:
is_update = False
is_latest = True
return (is_update, release_json)
return (is_latest, release_json)
else:
print(request.text)
return (False, {})

View File

@@ -83,6 +83,9 @@ def download(
)
return
search_results = search_results["results"]
if not search_results:
print("Nothing muches your search term")
exit_app(1)
search_results_ = {
search_result["title"]: search_result for search_result in search_results
}

View File

@@ -76,6 +76,9 @@ def grab(
continue
search_results = search_results["results"]
if not search_results:
logger.error("no results for your search")
exit(1)
search_results_ = {
search_result["title"]: search_result for search_result in search_results
}
@@ -145,9 +148,9 @@ def grab(
if episode_streams_only:
grabbed_anime[episode] = episode_streams
else:
grabbed_anime["episodes_streams"][
grabbed_anime["episodes_streams"][ # pyright:ignore
episode
] = episode_streams # pyright:ignore
] = episode_streams
except Exception as e:
logger.error(e)

View File

@@ -24,8 +24,8 @@ def update(
console.print(body)
if check:
is_update, github_release_data = check_for_updates()
if is_update:
is_latest, github_release_data = check_for_updates()
if not is_latest:
print(
f"You are running an older version ({__version__}) of fastanime please update to get the latest features"
)
@@ -36,3 +36,7 @@ def update(
else:
success, github_release_data = update_app()
_print_release(github_release_data)
if success:
print("Successfully updated")
else:
print("failed to update")

View File

@@ -183,7 +183,7 @@ class AnimePaheApi(AnimeProvider):
# get the episode title
episode_title = (
f"{episode["title"] or anime['title']}; Episode {episode['episode']}"
f"{episode['title'] or anime['title']}; Episode {episode['episode']}"
)
# get all links
streams = {

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "fastanime"
version = "2.2.4"
version = "2.2.6"
description = "A browser anime site experience from the terminal"
authors = ["Benextempest <benextempest@gmail.com>"]
license = "UNLICENSE"

View File

@@ -60,6 +60,11 @@ def test_update_help(runner: CliRunner):
assert result.exit_code == 0
def test_grab_help(runner: CliRunner):
result = runner.invoke(run_cli, ["grab", "--help"])
assert result.exit_code == 0
def test_anilist_help(runner: CliRunner):
result = runner.invoke(run_cli, ["anilist", "--help"])
assert result.exit_code == 0