mirror of https://github.com/Xhofe/alist
feat(baidu): update upload progress
parent
68a6a0c40e
commit
889ddcef7e
|
@ -202,7 +202,7 @@ func (d *BaiduNetdisk) Put(ctx context.Context, dstDir model.Obj, stream model.F
|
||||||
"uploadid": precreateResp.Uploadid,
|
"uploadid": precreateResp.Uploadid,
|
||||||
}
|
}
|
||||||
left = stream.GetSize()
|
left = stream.GetSize()
|
||||||
for _, partseq := range precreateResp.BlockList {
|
for i, partseq := range precreateResp.BlockList {
|
||||||
byteSize := Default
|
byteSize := Default
|
||||||
var byteData []byte
|
var byteData []byte
|
||||||
if left < Default {
|
if left < Default {
|
||||||
|
@ -223,6 +223,9 @@ func (d *BaiduNetdisk) Put(ctx context.Context, dstDir model.Obj, stream model.F
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Debugln(res.String())
|
log.Debugln(res.String())
|
||||||
|
if len(precreateResp.BlockList) > 0 {
|
||||||
|
up(i * 100 / len(precreateResp.BlockList))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_, err = d.create(path, stream.GetSize(), 0, precreateResp.Uploadid, block_list_str)
|
_, err = d.create(path, stream.GetSize(), 0, precreateResp.Uploadid, block_list_str)
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue