Compare commits

...

3 Commits

Author SHA1 Message Date
benex
5fb9747285 fix: default ui not persisting when using config --update 2024-09-15 14:59:01 +03:00
benex
394228d391 chore: bump version 2024-09-15 14:42:54 +03:00
benex
5d3c0cc6ec fix: unicode error on windows when writing the config file 2024-09-15 14:38:50 +03:00
5 changed files with 9 additions and 8 deletions

View File

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

View File

@@ -268,10 +268,11 @@ def run_cli(
ctx.obj.downloads_dir = downloads_dir
if translation_type:
ctx.obj.translation_type = translation_type
if fzf:
ctx.obj.use_fzf = True
if default:
ctx.obj.use_fzf = False
ctx.obj.use_rofi = False
if fzf:
ctx.obj.use_fzf = True
if preview:
ctx.obj.preview = True
if no_preview:

View File

@@ -94,8 +94,8 @@ def config(user_config: "Config", path, view, desktop_entry, update):
print(f"Successfully wrote \n{f.read()}")
exit_app(0)
elif update:
with open(USER_CONFIG_PATH, "w") as file:
file.write(user_config.__repr__())
with open(USER_CONFIG_PATH, "w",encoding="utf-8") as file:
file.write(user_config.__str__())
print("update successfull")
else:
click.edit(filename=USER_CONFIG_PATH)

View File

@@ -64,7 +64,7 @@ class Config(object):
# --- set config values from file or using defaults ---
if os.path.exists(USER_CONFIG_PATH):
self.configparser.read(USER_CONFIG_PATH)
self.configparser.read(USER_CONFIG_PATH,encoding="utf-8")
self.downloads_dir = self.get_downloads_dir()
self.sub_lang = self.get_sub_lang()
@@ -103,7 +103,7 @@ class Config(object):
os.environ["CURRENT_FASTANIME_PROVIDER"] = self.provider
if not os.path.exists(USER_CONFIG_PATH):
with open(USER_CONFIG_PATH, "w") as config:
with open(USER_CONFIG_PATH, "w",encoding="utf-8") as config:
config.write(self.__repr__())
def update_user(self, user):

View File

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