onedrive: fix setting modification time on directories for onedrive Personal

Onedrive Personal started ignoring the time parameters given to create
directory in the same way as onedrive Business.
This commit is contained in:
Nick Craig-Wood
2026-01-29 21:31:51 +00:00
parent d660960775
commit c64161822d
2 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -133,7 +133,7 @@ type RemoteItemFacet struct {
// FolderFacet groups folder-related data on OneDrive into a single structure
type FolderFacet struct {
ChildCount int64 `json:"childCount"` // Number of children contained immediately within this container.
ChildCount int64 `json:"childCount,omitempty"` // Number of children contained immediately within this container.
}
// HashesType groups different types of hashes into a single structure, for an item on OneDrive.
+4 -6
View File
@@ -816,15 +816,13 @@ func (f *Fs) MkdirMetadata(ctx context.Context, dir string, metadata fs.Metadata
if err != nil {
return nil, err
}
info, meta, err = f.createDir(ctx, parentID, dir, leaf, metadata)
_, meta, err = f.createDir(ctx, parentID, dir, leaf, metadata)
if err != nil {
return nil, err
}
if f.driveType != driveTypePersonal {
// for some reason, OneDrive Business needs this extra step to set modtime, while Personal does not. Seems like a bug...
fs.Debugf(dir, "setting time %v", meta.mtime)
info, err = meta.Write(ctx, false)
}
// for some reason, OneDrive Business and Personal needs this extra step to set modtime. Seems like a bug...
fs.Debugf(dir, "setting time %v", meta.mtime)
info, err = meta.Write(ctx, false)
} else if err == nil {
// Directory exists and needs updating
info, meta, err = f.updateDir(ctx, dirID, dir, metadata)