mirror of https://github.com/Xhofe/alist
🐛 fix windows onedrive path
parent
74d86f8cc4
commit
82272fcbf5
|
@ -48,6 +48,7 @@ func init() {
|
||||||
|
|
||||||
func (o Onedrive) GetMetaUrl(account *model.Account, auth bool, path string) string {
|
func (o Onedrive) GetMetaUrl(account *model.Account, auth bool, path string) string {
|
||||||
path = filepath.Join(account.RootFolder, path)
|
path = filepath.Join(account.RootFolder, path)
|
||||||
|
log.Debugf(path)
|
||||||
host, _ := onedriveHostMap[account.Zone]
|
host, _ := onedriveHostMap[account.Zone]
|
||||||
if auth {
|
if auth {
|
||||||
return host.Oauth
|
return host.Oauth
|
||||||
|
@ -55,7 +56,7 @@ func (o Onedrive) GetMetaUrl(account *model.Account, auth bool, path string) str
|
||||||
switch account.OnedriveType {
|
switch account.OnedriveType {
|
||||||
case "onedrive":
|
case "onedrive":
|
||||||
{
|
{
|
||||||
if path == "/" {
|
if path == "/" || path == "\\" {
|
||||||
return fmt.Sprintf("%s/v1.0/me/drive/root", host.Api)
|
return fmt.Sprintf("%s/v1.0/me/drive/root", host.Api)
|
||||||
} else {
|
} else {
|
||||||
return fmt.Sprintf("%s/v1.0/me/drive/root:%s:", host.Api, path)
|
return fmt.Sprintf("%s/v1.0/me/drive/root:%s:", host.Api, path)
|
||||||
|
|
Loading…
Reference in New Issue