🐛 fix mediatrack can't mkdir #351

This commit is contained in:
微凉
2022-01-14 18:19:58 +08:00
parent 1640a52789
commit 55d244b726
3 changed files with 24 additions and 4 deletions

View File

@ -36,11 +36,13 @@ func (driver MediaTrack) Items() []base.Item {
Label: "Token",
Type: base.TypeString,
Description: "Unknown expiration time",
Required: true,
},
{
Name: "root_folder",
Label: "root folder file_id",
Type: base.TypeString,
Name: "root_folder",
Label: "root folder file_id",
Type: base.TypeString,
Required: true,
},
{
Name: "order_by",
@ -155,7 +157,7 @@ func (driver MediaTrack) MakeDir(path string, account *model.Account) error {
if err != nil {
return err
}
url := fmt.Sprintf("https://jayce.api.mediatrack.cn/v4/assets/%s/children", parentFile.Id)
url := fmt.Sprintf("https://jayce.api.mediatrack.cn/v3/assets/%s/children", parentFile.Id)
_, err = driver.Request(url, base.Post, nil, nil, nil, base.Json{
"type": 1,
"title": utils.Base(path),

View File

@ -8,6 +8,7 @@ import (
"github.com/Xhofe/alist/model"
"github.com/Xhofe/alist/utils"
"github.com/go-resty/resty/v2"
log "github.com/sirupsen/logrus"
"path"
"strconv"
"time"
@ -58,6 +59,7 @@ func (driver MediaTrack) Request(url string, method int, headers, query, form ma
if err != nil {
return nil, err
}
log.Debugln(res.String())
if e.Status != "SUCCESS" {
return nil, errors.New(e.Message)
}