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.
This commit is contained in:
Nick Craig-Wood
2026-07-17 18:29:39 +01:00
parent 846f571eb7
commit 55b95489f3
+7
View File
@@ -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)