aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-07-09 03:30:35 +0200
committerdec05eba <dec05eba@protonmail.com>2021-07-09 03:30:35 +0200
commit38ee006289835a975a8855c90eb89f2baf103fe0 (patch)
tree4785836de05a8f11a19f5e9331cd60b00f441473
parent0faa50fbad30968b0bc8ab302cad9cc9d0b8dd68 (diff)
Speedup open_media.py
-rwxr-xr-xopen_media.py2
-rw-r--r--src/fileutils.c4
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);