diff --git a/src/octoprint/timelapse.py b/src/octoprint/timelapse.py index a3cff03e..7d203c4c 100644 --- a/src/octoprint/timelapse.py +++ b/src/octoprint/timelapse.py @@ -194,7 +194,8 @@ def delete_old_unrendered_timelapses(): if prefix in prefixes_to_clean: continue - if entry.stat().st_mtime < cutoff: + # delete if both creation and modification time are older than the cutoff + if max(entry.stat().st_ctime, entry.stat().st_mtime) < cutoff: prefixes_to_clean.append(prefix) except: if logging.getLogger(__name__).isEnabledFor(logging.DEBUG):