From 2d6b75014b28bc48b4b1a0a8e649f98394795ee8 Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Tue, 4 Feb 2025 03:19:33 +0800 Subject: [PATCH] add test.py --- test.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test.py diff --git a/test.py b/test.py new file mode 100644 index 0000000..6e08da0 --- /dev/null +++ b/test.py @@ -0,0 +1,13 @@ +from src.common.naming import FileNaming +import os + +dir_path = "/mnt/Comics/CBZ/rm_comic" +for dir in os.listdir(dir_path): + c_dir = os.path.join(dir_path, dir) + if os.path.isdir(c_dir): + files = list(FileNaming.get_filenames_optimized(c_dir, ext_filter=['.CBZ'])) + for file in files: + size = os.path.getsize(file) + if size < 3000: + os.remove(file) + print(f"已删除{file}") \ No newline at end of file