autoremove should not break if file doesnt exist

This commit is contained in:
Ville Rantanen
2019-07-31 10:45:17 +03:00
parent 83441a3622
commit 1fa2fcfe06

View File

@@ -84,6 +84,8 @@ def file_autoremove(path, share, notifier = None):
share['path'], share['path'],
path path
) )
if not os.path.exists(full_path):
return False
age, age_str = file_age(full_path) age, age_str = file_age(full_path)
if age.days >= autoremove: if age.days >= autoremove:
os.remove(full_path) os.remove(full_path)