Skip to content

Commit 46f123c

Browse files
committed
PASTE reconstruction debug
1 parent b6d6e17 commit 46f123c

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

pkg/drives/base.go

+11
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ func GetResourceService(srcType string) (ResourceService, error) {
8282
}
8383
}
8484

85+
func GetExtRemains(dstType string) bool {
86+
switch dstType {
87+
case SrcTypeDrive, SrcTypeCache, SrcTypeSync:
88+
return false
89+
case SrcTypeGoogle, SrcTypeCloud, SrcTypeAWSS3, SrcTypeTencent, SrcTypeDropbox:
90+
return true
91+
default:
92+
return false
93+
}
94+
}
95+
8596
type BaseResourceService struct{}
8697

8798
func (rs *BaseResourceService) GetHandler(w http.ResponseWriter, r *http.Request, d *common.Data) (int, error) {

pkg/drives/cache.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func (rs *CacheResourceService) PasteFileFrom(fs afero.Fs, srcType, src, dstType
178178
return os.ErrPermission
179179
}
180180

181-
extRemains := false
181+
extRemains := GetExtRemains(dstType)
182182
var bufferPath string
183183

184184
var err error

pkg/drives/drive.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (rs *DriveResourceService) PasteFileFrom(fs afero.Fs, srcType, src, dstType
108108
return os.ErrPermission
109109
}
110110

111-
extRemains := false
111+
extRemains := GetExtRemains(dstType)
112112
var bufferPath string
113113
fileInfo, status, err := ResourceDriveGetInfo(src, r, d)
114114
if status != http.StatusOK {

pkg/drives/sync.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ func (rs *SyncResourceService) PasteFileFrom(fs afero.Fs, srcType, src, dstType,
326326
return os.ErrPermission
327327
}
328328

329-
extRemains := false
329+
extRemains := GetExtRemains(dstType)
330330
var bufferPath string
331331

332332
var err error

0 commit comments

Comments
 (0)