From 1c1c2457e8e45615fbb06a5a37818bd1ce1ef5b7 Mon Sep 17 00:00:00 2001 From: benex Date: Sun, 15 Sep 2024 10:05:20 +0300 Subject: [PATCH] feat: improve the preview with a workaround --- fastanime/cli/interfaces/utils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fastanime/cli/interfaces/utils.py b/fastanime/cli/interfaces/utils.py index cc7b862..6f058bb 100644 --- a/fastanime/cli/interfaces/utils.py +++ b/fastanime/cli/interfaces/utils.py @@ -93,7 +93,7 @@ def write_search_results( # NOTE: Will probably make this a configuraable option HEADER_COLOR = 215, 0, 95 SEPARATOR_COLOR = 208, 208, 208 - SEPARATOR_WIDTH = 25 + SEPARATOR_WIDTH = 30 # use concurency to download and write as fast as possible with concurrent.futures.ThreadPoolExecutor(max_workers=workers) as executor: future_to_task = {} @@ -342,7 +342,11 @@ def get_fzf_anime_preview( preview = """ %s title={} - if [ -s "%s\\\\\\$title" ]; then echo image preview for windows is still being fixed hope you understand + dim=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES} + if [ -s "%s\\\\\\$title" ]; then + if command -v chafa >/dev/null;then + chafa -f kitty -s $dim "%s\\\\\\$title" + fi else echo Loading... fi if [ -s "%s\\\\\\$title" ]; then cat "%s\\\\\\$title" @@ -351,6 +355,7 @@ def get_fzf_anime_preview( """ % ( fzf_preview, IMAGES_CACHE_DIR.replace("\\","\\\\\\"), + IMAGES_CACHE_DIR.replace("\\","\\\\\\"), ANIME_INFO_CACHE_DIR.replace("\\","\\\\\\"), ANIME_INFO_CACHE_DIR.replace("\\","\\\\\\"), )