From 38ee006289835a975a8855c90eb89f2baf103fe0 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 9 Jul 2021 03:30:35 +0200 Subject: Speedup open_media.py --- open_media.py | 2 +- src/fileutils.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/open_media.py b/open_media.py index f894a61..d9d5ba3 100755 --- a/open_media.py +++ b/open_media.py @@ -40,7 +40,7 @@ def get_manga_chapters_in_dir(manga_dir): files = [] for filename in os.listdir(manga_dir): full_path = os.path.join(manga_dir, filename) - if os.path.isdir(full_path) and not os.path.exists(os.path.join(full_path, ".in_progress")) and os.path.exists(os.path.join(full_path, ".finished")): + if os.path.isdir(full_path) and not os.path.exists(os.path.join(full_path, ".in_progress")): files.append(full_path) return files diff --git a/src/fileutils.c b/src/fileutils.c index 48cf825..197a201 100644 --- a/src/fileutils.c +++ b/src/fileutils.c @@ -93,7 +93,7 @@ int create_directory_recursive(char *path) { return 0; } -static int is_path(const char *path) { +static int is_directory(const char *path) { struct stat s; if(stat(path, &s) == 0) return S_ISDIR(s.st_mode); @@ -122,7 +122,7 @@ static int remove_recursive_mutable(char *path) { int is_dir = dir->d_type == DT_DIR; if(dir->d_type == DT_UNKNOWN) - is_dir = is_path(path); + is_dir = is_directory(path); if(is_dir) { res = remove_recursive_mutable(path); -- cgit v1.2.3