feat(aliyundrive_open): optional delete file directly (close #3769)

This commit is contained in:
Andy Hsu 2023-03-08 19:19:13 +08:00
parent 2379cb8d67
commit 5596661ce8
2 changed files with 6 additions and 1 deletions

View File

@ -125,7 +125,11 @@ func (d *AliyundriveOpen) Copy(ctx context.Context, srcObj, dstDir model.Obj) er
}
func (d *AliyundriveOpen) Remove(ctx context.Context, obj model.Obj) error {
_, err := d.request("/adrive/v1.0/openFile/recyclebin/trash", http.MethodPost, func(req *resty.Request) {
uri := "/adrive/v1.0/openFile/recyclebin/trash"
if d.RemoveWay == "delete" {
uri = "/adrive/v1.0/openFile/delete"
}
_, err := d.request(uri, http.MethodPost, func(req *resty.Request) {
req.SetBody(base.Json{
"drive_id": d.DriveId,
"file_id": obj.GetID(),

View File

@ -13,6 +13,7 @@ type Addition struct {
OauthTokenURL string `json:"oauth_token_url" default:"https://api.nn.ci/alist/ali_open/token"`
ClientID string `json:"client_id" required:"false" help:"Keep it empty if you don't have one"`
ClientSecret string `json:"client_secret" required:"false" help:"Keep it empty if you don't have one"`
RemoveWay string `json:"remove_way" required:"true" type:"select" options:"trash,delete"`
}
var config = driver.Config{