From d3aa327ac6917bb0ddc77fa0ef15b22cd83b2fe0 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 18 Feb 2013 21:32:46 -0800 Subject: [PATCH] fs: in recent, use file's EXIF time (or modtime) time instead of permanode time Change-Id: I4ca9132967fb781192ea981d883b242a2c159b49 --- pkg/fs/recent.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/fs/recent.go b/pkg/fs/recent.go index bc1c3e933..346617bf1 100644 --- a/pkg/fs/recent.go +++ b/pkg/fs/recent.go @@ -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, })