Browse Source

add a date to files using their mtime..

main
John-Mark Gurney 1 year ago
parent
commit
7666721ed6
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      FSStorage.py

+ 4
- 0
FSStorage.py View File

@@ -9,6 +9,7 @@ ffmpeg_path = '/usr/local/bin/ffmpeg'
ffmpeg_path = '/a/home/jmg/src/ffmpeg.tmp/ffmpeg'
ffmpeg_path = '/usr/local/bin/ffmpeg-devel'

import datetime
import FileDIDL
import errno
import itertools
@@ -202,6 +203,9 @@ class FSItem(FSObject, Item):
mimetype = kwargs.pop('mimetype')
kwargs['content'] = DynamicTrans(self.FSpath,
static.File(self.FSpath, mimetype))

kwargs['date'] = datetime.datetime.utcfromtimestamp(os.stat(self.FSpath).st_mtime).isoformat() + '+00:00'

Item.__init__(self, *args, **kwargs)
self.url = '%s/%s' % (self.cd.urlbase, self.id)
self.mimetype = mimetype


Loading…
Cancel
Save