diff --git a/README.md b/README.md
index a184aa9..d68472b 100644
--- a/README.md
+++ b/README.md
@@ -29,8 +29,8 @@
My Rice
- **Anilist results menu:**
- 
+**Anilist results menu:**
+
**Episodes menu preview:**

@@ -41,7 +41,6 @@
**Desktop notifications + episodes menu without image preview:**

-
@@ -729,7 +728,6 @@ fastanime serve
fastanime serve --host --port
```
-
### MPV specific commands
The project now allows on the fly media controls directly from mpv. This means you can go to the next or previous episode without the window ever closing thus offering a seamless experience.
@@ -855,7 +853,7 @@ player = mpv
We welcome your issues and feature requests. However, due to time constraints, I currently do not plan to add another provider.
But if you are willing to add one yourself pr's are welcome.
-If you find an anime title that does not correspond with a provider or is just weird just [edit the data file](https://github.com/FastAnime/FastAnime/blob/master/fastanime/Utility/data.py) and open a pr, i will ignore issues 😝.
+If you find an anime title that does not correspond with a provider or is just weird just [edit the data file](https://github.com/Benexl/FastAnime/blob/master/fastanime/Utility/data.py) and open a pr, i will ignore issues 😝.
## Receiving Support
@@ -872,7 +870,7 @@ For inquiries, join our [Discord Server](https://discord.gg/HBEmAwvbHV).
More pr's less issues 🙃
Those who contribute at least five times will be able to make changes to the repo without my review.
-Show your support by starring the GitHub repository or [buying me a coffee](https://ko-fi.com/benex254).
+Show your support by starring the GitHub repository or [buying me a coffee](https://ko-fi.com/benexl).
## Disclaimer
@@ -880,4 +878,4 @@ Show your support by starring the GitHub repository or [buying me a coffee](http
>
> This project currently scrapes allanime, hianime, nyaa, yugen and animepahe.
> The developer(s) of this application does not have any affiliation with the content providers available, and this application hosts zero content.
-> [DISCLAIMER](https://github.com/Benex254/FastAnime/blob/master/DISCLAIMER.md)
+> [DISCLAIMER](https://github.com/Benexl/FastAnime/blob/master/DISCLAIMER.md)
diff --git a/fastanime/__init__.py b/fastanime/__init__.py
index c8bbc66..80c383b 100644
--- a/fastanime/__init__.py
+++ b/fastanime/__init__.py
@@ -9,7 +9,7 @@ if sys.version_info < (3, 10):
__version__ = "v2.8.3"
APP_NAME = "FastAnime"
-AUTHOR = "Benex254"
+AUTHOR = "Benexl"
GIT_REPO = "github.com"
REPO = f"{GIT_REPO}/{AUTHOR}/{APP_NAME}"
diff --git a/fastanime/cli/__init__.py b/fastanime/cli/__init__.py
index f51829a..fc92b76 100644
--- a/fastanime/cli/__init__.py
+++ b/fastanime/cli/__init__.py
@@ -222,48 +222,60 @@ def run_cli(
fresh_requests,
):
import os
+ import sys
from .config import Config
ctx.obj = Config()
- # TODO: only check once per week or day
- # so as to not hit api limit
- # for now i have disabled it
- if ctx.obj.check_for_updates and ctx.invoked_subcommand != "completions" and False:
- from .app_updater import check_for_updates
- import sys
+ if (
+ ctx.obj.check_for_updates
+ and ctx.invoked_subcommand != "completions"
+ and "notifier" not in sys.argv
+ ):
+ import time
- print("Checking for updates...", file=sys.stderr)
- print("So you can enjoy the latest features and bug fixes", file=sys.stderr)
- print(
- "You can disable this by setting check_for_updates to False in the config",
- file=sys.stderr,
- )
- is_latest, github_release_data = check_for_updates()
- if not is_latest:
- from rich.console import Console
- from rich.markdown import Markdown
- from .app_updater import update_app
- from rich.prompt import Confirm
+ last_update = ctx.obj.user_data["meta"]["last_updated"]
+ now = time.time()
+ # checks after every 12 hours
+ if (now - last_update) > 43200:
+ ctx.obj.user_data["meta"]["last_updated"] = now
+ ctx.obj._update_user_data()
- def _print_release(release_data):
- console = Console()
- body = Markdown(release_data["body"])
- tag = github_release_data["tag_name"]
- tag_title = release_data["name"]
- github_page_url = release_data["html_url"]
- console.print(f"Release Page: {github_page_url}")
- console.print(f"Tag: {tag}")
- console.print(f"Title: {tag_title}")
- console.print(body)
+ from .app_updater import check_for_updates
- if Confirm.ask(
- "A new version of fastanime is available, would you like to update?"
- ):
- _, release_json = update_app()
- print("Successfully updated")
- _print_release(release_json)
- exit(0)
+ print("Checking for updates...", file=sys.stderr)
+ print("So you can enjoy the latest features and bug fixes", file=sys.stderr)
+ print(
+ "You can disable this by setting check_for_updates to False in the config",
+ file=sys.stderr,
+ )
+ is_latest, github_release_data = check_for_updates()
+ if not is_latest:
+ from rich.console import Console
+ from rich.markdown import Markdown
+ from .app_updater import update_app
+ from rich.prompt import Confirm
+
+ def _print_release(release_data):
+ console = Console()
+ body = Markdown(release_data["body"])
+ tag = github_release_data["tag_name"]
+ tag_title = release_data["name"]
+ github_page_url = release_data["html_url"]
+ console.print(f"Release Page: {github_page_url}")
+ console.print(f"Tag: {tag}")
+ console.print(f"Title: {tag_title}")
+ console.print(body)
+
+ if Confirm.ask(
+ "A new version of fastanime is available, would you like to update?"
+ ):
+ _, release_json = update_app()
+ print("Successfully updated")
+ _print_release(release_json)
+ exit(0)
+ else:
+ print("You are using the latest version of fastanime", file=sys.stderr)
ctx.obj.manga = manga
if log:
diff --git a/fastanime/cli/config.py b/fastanime/cli/config.py
index e5263ca..bbfa8a1 100644
--- a/fastanime/cli/config.py
+++ b/fastanime/cli/config.py
@@ -29,7 +29,12 @@ class Config(object):
"https://anilist.co/api/v2/oauth/authorize?client_id=20148&response_type=token"
)
anime_provider: "AnimeProvider"
- user_data = {"recent_anime": [], "animelist": [], "user": {}}
+ user_data = {
+ "recent_anime": [],
+ "animelist": [],
+ "user": {},
+ "meta": {"last_updated": 0},
+ }
default_config = {
"auto_next": "False",
"menu_order": "",
@@ -484,7 +489,7 @@ auto_next = {self.auto_next}
# But 99% of the time will be accurate
# if this happens just turn off auto_select in the menus or from the commandline
# and manually select the correct anime title
-# edit this file
+# edit this file
# and to the dictionary of the provider
# the provider title (key) and their corresponding anilist names (value)
# and then please open a pr
@@ -556,7 +561,7 @@ player = {self.player}
#
# HOPE YOU ENJOY FASTANIME AND BE SURE TO STAR THE PROJECT ON GITHUB
-# https://github.com/Benex254/FastAnime
+# https://github.com/Benexl/FastAnime
#
# Also join the discord server
# where the anime tech community lives :)