From 55b95489f371b53ac5369f2f2d19f66a4d8ef1a7 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 17 Jul 2026 08:47:31 +0100 Subject: [PATCH] imagekit: add mtime to the available metadata The backend declares ReadMetadata but did not return the standard mtime key, so the modification time was missing from the metadata. --- backend/imagekit/imagekit.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/imagekit/imagekit.go b/backend/imagekit/imagekit.go index 0c8521d0d..44c193ec8 100644 --- a/backend/imagekit/imagekit.go +++ b/backend/imagekit/imagekit.go @@ -32,6 +32,12 @@ const ( ) var systemMetadataInfo = map[string]fs.MetadataHelp{ + "mtime": { + Help: "Time of last modification, read from the file's updatedAt field", + Type: "RFC 3339", + Example: "2006-01-02T15:04:05.999999999Z07:00", + ReadOnly: true, + }, "btime": { Help: "Time of file birth (creation) read from Last-Modified header", Type: "RFC 3339", @@ -759,6 +765,7 @@ func uploadFile(ctx context.Context, f *Fs, in io.Reader, srcRemote string, opti // Metadata returns the metadata for the object func (o *Object) Metadata(ctx context.Context) (metadata fs.Metadata, err error) { + metadata.Set("mtime", o.file.UpdatedAt.Format(time.RFC3339Nano)) metadata.Set("btime", o.file.CreatedAt.Format(time.RFC3339)) metadata.Set("size", strconv.FormatUint(o.file.Size, 10)) metadata.Set("file-type", o.file.FileType)