From 2fe5edf810ab6e6868e79b1b3b6f52d585976f02 Mon Sep 17 00:00:00 2001 From: Benex254 Date: Sat, 5 Oct 2024 11:47:52 +0300 Subject: [PATCH] feat(cli): make all threads daemon threads --- fastanime/cli/commands/download.py | 6 +++--- fastanime/cli/commands/downloads.py | 2 ++ fastanime/cli/interfaces/utils.py | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fastanime/cli/commands/download.py b/fastanime/cli/commands/download.py index 9f60b3b..9af4ca0 100644 --- a/fastanime/cli/commands/download.py +++ b/fastanime/cli/commands/download.py @@ -361,9 +361,9 @@ def download( episode_title, download_dir, silent, - config.format, - force_unknown_ext, - verbose, + vid_format=config.format, + force_unknown_ext=force_unknown_ext, + verbose=verbose, headers=provider_headers, sub=subtitles[0]["url"] if subtitles else "", merge=merge, diff --git a/fastanime/cli/commands/downloads.py b/fastanime/cli/commands/downloads.py index ac37683..7d71a1d 100644 --- a/fastanime/cli/commands/downloads.py +++ b/fastanime/cli/commands/downloads.py @@ -169,6 +169,7 @@ def downloads( from threading import Thread worker = Thread(target=_worker) + worker.daemon = True worker.start() else: _worker() @@ -241,6 +242,7 @@ def downloads( from threading import Thread worker = Thread(target=_worker) + worker.daemon = True worker.start() else: _worker() diff --git a/fastanime/cli/interfaces/utils.py b/fastanime/cli/interfaces/utils.py index 072ea3d..84af8a0 100644 --- a/fastanime/cli/interfaces/utils.py +++ b/fastanime/cli/interfaces/utils.py @@ -241,6 +241,7 @@ def get_fzf_manga_preview(manga_results, workers=None, wait=False): background_worker = Thread( target=_worker, ) + background_worker.daemon = True # ensure images and info exists background_worker.start() @@ -322,6 +323,7 @@ def get_fzf_episode_preview( background_worker = Thread( target=_worker, ) + background_worker.daemon = True # ensure images and info exists background_worker.start() @@ -399,6 +401,7 @@ def get_fzf_anime_preview( background_worker = Thread( target=write_search_results, args=(anilist_results, titles) ) + background_worker.daemon = True background_worker.start() # the preview script is in bash so making sure fzf doesnt use any other shell lang to process the preview script