fs: in recent, use file's EXIF time (or modtime) time instead of permanode time

Change-Id: I4ca9132967fb781192ea981d883b242a2c159b49
This commit is contained in:
Brad Fitzpatrick 2013-02-18 21:32:46 -08:00
parent ace9474d95
commit d3aa327ac6
1 changed files with 6 additions and 2 deletions

View File

@ -65,6 +65,7 @@ func (n *recentDir) ReadDir(intr fuse.Intr) ([]fuse.Dirent, fuse.Error) {
var ents []fuse.Dirent
for _, ri := range res.Recent {
modTime := ri.ModTime.Time()
meta := res.Meta.Get(ri.BlobRef)
if meta == nil || meta.Permanode == nil {
continue
@ -81,6 +82,9 @@ func (n *recentDir) ReadDir(intr fuse.Intr) ([]fuse.Dirent, fuse.Error) {
switch {
case ccMeta.File != nil:
name = ccMeta.File.FileName
if mt := ccMeta.File.Time; !mt.IsZero() {
modTime = mt.Time()
}
case ccMeta.Dir != nil:
name = ccMeta.Dir.FileName
default:
@ -93,8 +97,8 @@ func (n *recentDir) ReadDir(intr fuse.Intr) ([]fuse.Dirent, fuse.Error) {
}
}
n.ents[name] = ccMeta
n.modTime[name] = ri.ModTime.Time()
log.Printf("fs.recent: name %q = %v (at %v)", name, ccMeta.BlobRef, ri.ModTime.Time())
n.modTime[name] = modTime
log.Printf("fs.recent: name %q = %v (at %v -> %v)", name, ccMeta.BlobRef, ri.ModTime.Time(), modTime)
ents = append(ents, fuse.Dirent{
Name: name,
})