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:
@@ -32,6 +32,12 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var systemMetadataInfo = map[string]fs.MetadataHelp{
|
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": {
|
"btime": {
|
||||||
Help: "Time of file birth (creation) read from Last-Modified header",
|
Help: "Time of file birth (creation) read from Last-Modified header",
|
||||||
Type: "RFC 3339",
|
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
|
// Metadata returns the metadata for the object
|
||||||
func (o *Object) Metadata(ctx context.Context) (metadata fs.Metadata, err error) {
|
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("btime", o.file.CreatedAt.Format(time.RFC3339))
|
||||||
metadata.Set("size", strconv.FormatUint(o.file.Size, 10))
|
metadata.Set("size", strconv.FormatUint(o.file.Size, 10))
|
||||||
metadata.Set("file-type", o.file.FileType)
|
metadata.Set("file-type", o.file.FileType)
|
||||||
|
|||||||
Reference in New Issue
Block a user