Skip to content

Commit

Permalink
Fix: Ensure correct "upload date" for all added files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
foosel committed Jun 29, 2015
1 parent d5692d7 commit 5f0c89c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/octoprint/filemanager/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ def add_file(self, path, file_object, printer_profile=None, links=None, allow_ov

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):
Expand Down

0 comments on commit 5f0c89c

Please sign in to comment.