Skip to content

Commit bbb80f4

Browse files
committed
update config.ini and file.py
1 parent 0d646de commit bbb80f4

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

config.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Settings]
2-
SEARCH_PATHS = C:\Users\Wreck\Downloads\,I:\Downloads,J:\Downloads
2+
SEARCH_PATHS = C:\Users\Wreck\Downloads\,I:\Downloads,J:\Downloads,F:\Recordings
33
EXTRACTABLE_EXTENSIONS = zip|rar
44
DAYS_UNTIL_DELETION = 14
55
START_WITH_WINDOWS = true

wfc/file.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def get_days_since_creation(path: str) -> int:
8282
elif os.path.isdir(path):
8383
creation_time = os.path.getctime(os.path.join(path, ""))
8484
else:
85-
return 0 # Return 0 if the path is neither a file nor a folder
85+
return 0
8686

8787
creation_date = datetime.datetime.fromtimestamp(creation_time)
8888
current_date = datetime.datetime.now()
@@ -94,14 +94,14 @@ def has_extracted_folder(file_path: str) -> bool:
9494
return os.path.isdir(folder_path)
9595

9696

97-
def delete_file_or_folder(_path: str, _isfile: bool):
97+
def delete_file_or_folder(path: str, isfile: bool):
9898
if TESTMODE:
9999
return
100100
with contextlib.suppress(FileNotFoundError):
101-
if _isfile:
102-
os.remove(_path)
101+
if isfile:
102+
os.remove(path)
103103
return
104-
shutil.rmtree(_path)
104+
shutil.rmtree(path)
105105

106106

107107
def handle_startup() -> None:
@@ -138,6 +138,9 @@ def process_things():
138138

139139
for items, is_file in ((folders_to_delete, False), (files_to_delete, True)):
140140
for path, size_bytes, reason in items:
141+
if not os.path.exists(path):
142+
continue
143+
141144
basename = os.path.basename(path)
142145

143146
if is_file:

0 commit comments

Comments
 (0)