mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
pikpak: fix cid/gcid calculations for fs.OverrideRemote
Previously, cid/gcid (custom hash for pikpak) calculations failed when attempting to unwrap object info from `fs.OverrideRemote`. This commit introduces a new function that can correctly unwrap object info from both regular objects and `fs.OverrideRemote` types, ensuring uploads with accurate cid/gcid calculations in all scenarios.
This commit is contained in:
@@ -1773,7 +1773,7 @@ func (o *Object) upload(ctx context.Context, in io.Reader, src fs.ObjectInfo, wi
|
||||
gcid, err := o.fs.getGcid(ctx, src)
|
||||
if err != nil || gcid == "" {
|
||||
fs.Debugf(o, "calculating gcid: %v", err)
|
||||
if srcObj := fs.UnWrapObjectInfo(src); srcObj != nil && srcObj.Fs().Features().IsLocal {
|
||||
if srcObj := unWrapObjectInfo(src); srcObj != nil && srcObj.Fs().Features().IsLocal {
|
||||
// No buffering; directly calculate gcid from source
|
||||
rc, err := srcObj.Open(ctx)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user