onedrive: Onedrive Personal no longer supports description

Uploading files with description set is no longer allowed with
Onedrive personal. This brings it into line with Onedrive business.
This commit is contained in:
Nick Craig-Wood
2026-01-29 21:31:51 +00:00
parent c64161822d
commit 8a31921fb0
2 changed files with 6 additions and 15 deletions
+3 -10
View File
@@ -60,7 +60,7 @@ var systemMetadataInfo = map[string]fs.MetadataHelp{
ReadOnly: true, ReadOnly: true,
}, },
"description": { "description": {
Help: "A short description of the file. Max 1024 characters. Only supported for OneDrive Personal.", Help: "A short description of the file. Max 1024 characters. No longer supported by Microsoft.",
Type: "string", Type: "string",
Example: "Contract for signing", Example: "Contract for signing",
}, },
@@ -259,12 +259,8 @@ func (m *Metadata) Set(ctx context.Context, metadata fs.Metadata) (numSet int, e
m.btime = t m.btime = t
numSet++ numSet++
case "description": case "description":
if m.fs.driveType != driveTypePersonal { fs.Debugf(m.remote, "metadata description is no longer supported -- skipping: %s", v)
fs.Debugf(m.remote, "metadata description is only supported for OneDrive Personal -- skipping: %s", v) continue
continue
}
m.description = v
numSet++
case "permissions": case "permissions":
if !m.fs.opt.MetadataPermissions.IsSet(rwWrite) { if !m.fs.opt.MetadataPermissions.IsSet(rwWrite) {
continue continue
@@ -292,9 +288,6 @@ func (m *Metadata) toAPIMetadata() api.Metadata {
update := api.Metadata{ update := api.Metadata{
FileSystemInfo: &api.FileSystemInfoFacet{}, FileSystemInfo: &api.FileSystemInfoFacet{},
} }
if m.description != "" && m.fs.driveType == driveTypePersonal {
update.Description = m.description
}
if !m.mtime.IsZero() { if !m.mtime.IsZero() {
update.FileSystemInfo.LastModifiedDateTime = api.Timestamp(m.mtime) update.FileSystemInfo.LastModifiedDateTime = api.Timestamp(m.mtime)
} }
+3 -5
View File
@@ -159,7 +159,7 @@ func (f *Fs) TestReadMetadata(t *testing.T, r *fstest.Run) {
if slices.Contains(optionals, k) { if slices.Contains(optionals, k) {
continue continue
} }
if k == "description" && f.driveType != driveTypePersonal { if k == "description" {
continue // not supported continue // not supported
} }
gotV, ok := actualMeta[k] gotV, ok := actualMeta[k]
@@ -196,7 +196,7 @@ func (f *Fs) TestDirectoryMetadata(t *testing.T, r *fstest.Run) {
if slices.Contains(optionals, k) { if slices.Contains(optionals, k) {
continue continue
} }
if k == "description" && f.driveType != driveTypePersonal { if k == "description" {
continue // not supported continue // not supported
} }
gotV, ok := actualMeta[k] gotV, ok := actualMeta[k]
@@ -417,9 +417,7 @@ func (f *Fs) compareMeta(t *testing.T, expectedMeta, actualMeta fs.Metadata, ign
compareTimeStrings(t, k, v, gotV, time.Second) compareTimeStrings(t, k, v, gotV, time.Second)
continue continue
case "description": case "description":
if f.driveType != driveTypePersonal { continue // not supported
continue // not supported
}
} }
assert.True(t, ok, fmt.Sprintf("expected metadata key is missing: %v", k)) assert.True(t, ok, fmt.Sprintf("expected metadata key is missing: %v", k))
assert.Equal(t, v, gotV, actualMeta) assert.Equal(t, v, gotV, actualMeta)