mirror of
https://github.com/rclone/rclone
synced 2024-12-22 13:03:02 +01:00
backend/onedrive: my OneDrive as the default drive
set the /me/drive as the default drive to ensure it is automatically selected in non-interactive mode
This commit is contained in:
parent
ab58ae5b03
commit
142fa4179e
@ -15,6 +15,7 @@ import (
|
||||
"net/url"
|
||||
"path"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
@ -505,6 +506,10 @@ func chooseDrive(ctx context.Context, name string, m configmap.Mapper, srv *rest
|
||||
break
|
||||
}
|
||||
}
|
||||
// my OneDrive as the first drive
|
||||
sort.SliceStable(drives.Drives, func(i, j int) bool {
|
||||
return drives.Drives[i].DriveID == meDrive.DriveID
|
||||
})
|
||||
// add the me drive if not found already
|
||||
if !found {
|
||||
fs.Debugf(nil, "Adding %v to drives list from /me/drive", meDrive)
|
||||
|
Loading…
Reference in New Issue
Block a user