fix(driver): implement canceling and updating progress for putting for some drivers (#7847)
* fix(driver): additionally implement canceling and updating progress for putting for some drivers * refactor: add driver archive api into template * fix(123): use built-in MD5 to avoid caching full * . * fix build failed
This commit is contained in:
@ -3,6 +3,7 @@ package uss
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/alist-org/alist/v3/internal/stream"
|
||||
"net/url"
|
||||
"path"
|
||||
"strings"
|
||||
@ -122,11 +123,16 @@ func (d *USS) Remove(ctx context.Context, obj model.Obj) error {
|
||||
})
|
||||
}
|
||||
|
||||
func (d *USS) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) error {
|
||||
// TODO not support cancel??
|
||||
func (d *USS) Put(ctx context.Context, dstDir model.Obj, s model.FileStreamer, up driver.UpdateProgress) error {
|
||||
return d.client.Put(&upyun.PutObjectConfig{
|
||||
Path: getKey(path.Join(dstDir.GetPath(), stream.GetName()), false),
|
||||
Reader: stream,
|
||||
Path: getKey(path.Join(dstDir.GetPath(), s.GetName()), false),
|
||||
Reader: &stream.ReaderWithCtx{
|
||||
Reader: &stream.ReaderUpdatingProgress{
|
||||
Reader: s,
|
||||
UpdateProgress: up,
|
||||
},
|
||||
Ctx: ctx,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user