feat: adapt hash feature for some drivers (#5180)
* feat(pikpak,thunder): adaptation gcid hash * chore(weiyun): add note * feat(baidu_netdisk): adaptation rapid * feat(baidu_photo): adaptation hash * feat(189pc): adaptation rapid * feat(mopan):adaptation ctime * feat(139):adaptation hash and ctime --------- Co-authored-by: Andy Hsu <i@nn.ci>
This commit is contained in:
@ -308,14 +308,14 @@ func (d *WeiYun) Remove(ctx context.Context, obj model.Obj) error {
|
||||
}
|
||||
|
||||
func (d *WeiYun) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) (model.Obj, error) {
|
||||
// NOTE:
|
||||
// 秒传需要sha1最后一个状态,但sha1无法逆运算需要读完整个文件(或许可以??)
|
||||
// 服务器支持上传进度恢复,不需要额外实现
|
||||
if folder, ok := dstDir.(*Folder); ok {
|
||||
file, err := stream.CacheFullInTempFile()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer func() {
|
||||
_ = file.Close()
|
||||
}()
|
||||
|
||||
// step 1.
|
||||
preData, err := d.client.PreUpload(ctx, weiyunsdkgo.UpdloadFileParam{
|
||||
@ -333,7 +333,7 @@ func (d *WeiYun) Put(ctx context.Context, dstDir model.Obj, stream model.FileStr
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// fast upload
|
||||
// not fast upload
|
||||
if !preData.FileExist {
|
||||
// step.2 增加上传通道
|
||||
if len(preData.ChannelList) < d.uploadThread {
|
||||
|
Reference in New Issue
Block a user