1
0
mirror of https://github.com/rclone/rclone.git synced 2026-02-26 09:23:20 +00:00

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 17:54:07 +00:00
parent c64161822d
commit 8a31921fb0
2 changed files with 6 additions and 15 deletions

View File

@@ -60,7 +60,7 @@ var systemMetadataInfo = map[string]fs.MetadataHelp{
ReadOnly: true,
},
"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",
Example: "Contract for signing",
},
@@ -259,12 +259,8 @@ func (m *Metadata) Set(ctx context.Context, metadata fs.Metadata) (numSet int, e
m.btime = t
numSet++
case "description":
if m.fs.driveType != driveTypePersonal {
fs.Debugf(m.remote, "metadata description is only supported for OneDrive Personal -- skipping: %s", v)
continue
}
m.description = v
numSet++
fs.Debugf(m.remote, "metadata description is no longer supported -- skipping: %s", v)
continue
case "permissions":
if !m.fs.opt.MetadataPermissions.IsSet(rwWrite) {
continue
@@ -292,9 +288,6 @@ func (m *Metadata) toAPIMetadata() api.Metadata {
update := api.Metadata{
FileSystemInfo: &api.FileSystemInfoFacet{},
}
if m.description != "" && m.fs.driveType == driveTypePersonal {
update.Description = m.description
}
if !m.mtime.IsZero() {
update.FileSystemInfo.LastModifiedDateTime = api.Timestamp(m.mtime)
}

View File

@@ -159,7 +159,7 @@ func (f *Fs) TestReadMetadata(t *testing.T, r *fstest.Run) {
if slices.Contains(optionals, k) {
continue
}
if k == "description" && f.driveType != driveTypePersonal {
if k == "description" {
continue // not supported
}
gotV, ok := actualMeta[k]
@@ -196,7 +196,7 @@ func (f *Fs) TestDirectoryMetadata(t *testing.T, r *fstest.Run) {
if slices.Contains(optionals, k) {
continue
}
if k == "description" && f.driveType != driveTypePersonal {
if k == "description" {
continue // not supported
}
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)
continue
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.Equal(t, v, gotV, actualMeta)