fix(aliyundrive_open): upload progress for normal upload (#5398)

pull/5420/head
NewbieOrange 2023-10-19 19:17:09 +08:00 committed by GitHub
parent cdfbe6dcf2
commit 8ef8023c20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -5,7 +5,6 @@ import (
"context" "context"
"encoding/base64" "encoding/base64"
"fmt" "fmt"
"github.com/alist-org/alist/v3/pkg/http_range"
"io" "io"
"math" "math"
"net/http" "net/http"
@ -16,6 +15,7 @@ import (
"github.com/alist-org/alist/v3/drivers/base" "github.com/alist-org/alist/v3/drivers/base"
"github.com/alist-org/alist/v3/internal/driver" "github.com/alist-org/alist/v3/internal/driver"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/pkg/http_range"
"github.com/alist-org/alist/v3/pkg/utils" "github.com/alist-org/alist/v3/pkg/utils"
"github.com/avast/retry-go" "github.com/avast/retry-go"
"github.com/go-resty/resty/v2" "github.com/go-resty/resty/v2"
@ -258,6 +258,7 @@ func (d *AliyundriveOpen) upload(ctx context.Context, dstDir model.Obj, stream m
return nil, err return nil, err
} }
offset += partSize offset += partSize
up(i * 100 / count)
} }
} else { } else {
log.Debugf("[aliyundrive_open] rapid upload success, file id: %s", createResp.FileId) log.Debugf("[aliyundrive_open] rapid upload success, file id: %s", createResp.FileId)