Updated image display timestamp
authorThierry Florac <thierry.florac@onf.fr>
Mon, 27 Aug 2018 11:04:44 +0200
changeset 126 96984cb08552
parent 125 cefb393f983b
child 127 57ef05b46604
Updated image display timestamp
src/pyams_file/widget/__init__.py
--- a/src/pyams_file/widget/__init__.py	Fri Jul 20 12:45:59 2018 +0200
+++ b/src/pyams_file/widget/__init__.py	Mon Aug 27 11:04:44 2018 +0200
@@ -110,7 +110,12 @@
         if thumbnails is not None:
             display = thumbnails.get_thumbnail(geometry)
             if display is not None:
-                return '{0}?_={1}'.format(absolute_url(display, self.request), self.timestamp)
+                dc = IZopeDublinCore(display, None)
+                if dc is not None:
+                    timestamp = dc.modified.timestamp()
+                else:
+                    timestamp = self.timestamp
+                return '{0}?_={1}'.format(absolute_url(display, self.request), timestamp)
         name, ext = os.path.splitext(self.current_value.filename)
         return '/--static--/pyams_skin/img/mimetypes/{0}'.format(EXTENSIONS_THUMBNAILS.get(ext, 'unknown.png'))