From 1ead6e2d20105e9a2152cf0d08774deb6b0ea296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 29 Jun 2015 10:34:55 +0200 Subject: [PATCH] Fix: Ensure correct "upload date" for all added files Local file storage implementation will now "touch" added files to set modification date to current date, ensuring that files that are just moved through a custom implementation of file object (e.g. through the watched folder mechanism) will show with "now" as the upload date. (cherry picked from commit 5f0c89c) --- src/octoprint/filemanager/storage.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/octoprint/filemanager/storage.py b/src/octoprint/filemanager/storage.py index 6e855cce..9f238cf9 100644 --- a/src/octoprint/filemanager/storage.py +++ b/src/octoprint/filemanager/storage.py @@ -455,6 +455,9 @@ class LocalFileStorage(StorageInterface): self._add_links(name, path, links) + # touch the file to set last access and modification time to now + os.utime(file_path, None) + return self.path_in_storage((path, name)) def remove_file(self, path):