From 1fa2fcfe0661f5ef73280ba54db623af1f1fcb7b Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Wed, 31 Jul 2019 10:45:17 +0300 Subject: [PATCH] autoremove should not break if file doesnt exist --- code/utils/files.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/utils/files.py b/code/utils/files.py index 00e520c..6fb5fdc 100644 --- a/code/utils/files.py +++ b/code/utils/files.py @@ -84,6 +84,8 @@ def file_autoremove(path, share, notifier = None): share['path'], path ) + if not os.path.exists(full_path): + return False age, age_str = file_age(full_path) if age.days >= autoremove: os.remove(full_path)