Compare commits

..

6 Commits

Author SHA1 Message Date
Benex254
594c687c8b chore: remove art as dep 2024-08-09 16:02:29 +03:00
Benex254
91b5d3ea40 chore: bump version 2024-08-09 16:00:49 +03:00
Benex254
8c30a7667c feat(fzf): remove art and instead use a static header 2024-08-09 16:00:30 +03:00
Benex254
179fbe59ac feat(config): let python-mpv to bee disabled by default 2024-08-09 15:59:56 +03:00
Benex254
5bfc210f59 feat(cli): add option to enable or disable python-mpv 2024-08-09 15:59:31 +03:00
Benex254
eb9c200fca feat(mpv): remove useless print statement 2024-08-09 15:58:50 +03:00
7 changed files with 25 additions and 22 deletions

View File

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

View File

@@ -126,6 +126,9 @@ signal.signal(signal.SIGINT, handle_exit)
help="Rofi theme to use for the user input prompt",
type=click.Path(),
)
@click.option(
"--use-mpv-mod/--use-default-player", help="Whether to use python-mpv", type=bool
)
@click.pass_context
def run_cli(
ctx: click.Context,
@@ -155,6 +158,7 @@ def run_cli(
rofi_theme,
rofi_theme_confirm,
rofi_theme_input,
use_mpv_mod,
):
from .config import Config
@@ -217,6 +221,11 @@ def run_cli(
== click.core.ParameterSource.COMMANDLINE
):
ctx.obj.auto_select = auto_select
if (
ctx.get_parameter_source("use_mpv_mod")
== click.core.ParameterSource.COMMANDLINE
):
ctx.obj.use_mpv_mod = use_mpv_mod
if sort_by:
ctx.obj.sort_by = sort_by
if downloads_dir:

View File

@@ -47,7 +47,7 @@ class Config(object):
"rofi_theme": "",
"rofi_theme_input": "",
"rofi_theme_confirm": "",
"use_mpv_mod": "true",
"use_mpv_mod": "false",
"force_window": "immediate",
}
)

View File

@@ -178,7 +178,6 @@ class MpvPlayer(object):
property, time_remaining: float | None = None, *args
):
if time_remaining is not None:
print(time_remaining, self.player_fetching)
if time_remaining < 1 and config.auto_next and not self.player_fetching:
print("Auto Fetching Next Episode")
self.player_fetching = True

View File

@@ -6,7 +6,6 @@ import sys
from typing import Callable, List
# TODO: will probably scrap art not to useful
from art import text2art
from click import clear
from rich import print
@@ -22,6 +21,17 @@ FZF_DEFAULT_OPTS = """
--marker=">" --pointer="" --separator="" --scrollbar=""
"""
HEADER = """
███████╗░█████╗░░██████╗████████╗░█████╗░███╗░░██╗██╗███╗░░░███╗███████╗
██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔══██╗████╗░██║██║████╗░████║██╔════╝
█████╗░░███████║╚█████╗░░░░██║░░░███████║██╔██╗██║██║██╔████╔██║█████╗░░
██╔══╝░░██╔══██║░╚═══██╗░░░██║░░░██╔══██║██║╚████║██║██║╚██╔╝██║██╔══╝░░
██║░░░░░██║░░██║██████╔╝░░░██║░░░██║░░██║██║░╚███║██║██║░╚═╝░██║███████╗
╚═╝░░░░░╚═╝░░╚═╝╚═════╝░░░░╚═╝░░░╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░░░░╚═╝╚══════╝
"""
class FZF:
"""an abstraction over the fzf commandline utility
@@ -149,7 +159,7 @@ class FZF:
_commands = [
*self.default_options,
"--header",
text2art(header),
HEADER,
"--header-first",
"--prompt",
prompt.title(),

16
poetry.lock generated
View File

@@ -1,19 +1,5 @@
# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.
[[package]]
name = "art"
version = "6.2"
description = "ASCII Art Library For Python"
optional = false
python-versions = ">=3.5"
files = [
{file = "art-6.2-py3-none-any.whl", hash = "sha256:d632d1d3f5fabcaf8673abe934b51df0017bc914d106e89d45ae4ebef0e3149a"},
{file = "art-6.2.tar.gz", hash = "sha256:506a0c4f261289a0e0d088de7beffcb1835078c4e44b0c5353bdaf47b490e76f"},
]
[package.extras]
dev = ["bandit (>=1.5.1)", "coverage (>=4.1)", "pydocstyle (>=3.0.0)", "vulture (>=1.0)"]
[[package]]
name = "autoflake"
version = "2.3.1"
@@ -1421,4 +1407,4 @@ test = ["pytest (>=8.1,<9.0)"]
[metadata]
lock-version = "2.0"
python-versions = "^3.10"
content-hash = "5305621bc02d824065519913f0d754e269f1e4525ba8796be08504120614259d"
content-hash = "83ec7de7d9466dcd1fadef4b21eec2a879cc9a7d526992ed280b6af53b49d9f1"

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "fastanime"
version = "0.60.4.dev1"
version = "0.61.0.dev1"
description = "A browser anime site experience from the terminal"
authors = ["Benextempest <benextempest@gmail.com>"]
license = "UNLICENSE"
@@ -13,7 +13,6 @@ rich = "^13.7.1"
click = "^8.1.7"
inquirerpy = "^0.3.4"
platformdirs = "^4.2.2"
art = "^6.2"
python-dotenv = "^1.0.1"
thefuzz = "^0.22.1"
requests = "^2.32.3"