mirror of
https://github.com/rclone/rclone.git
synced 2025-08-19 09:52:05 +02:00
operations: ensure SrcFsType is set correctly when using --metadata-mapper
Before this change on files which have unknown length (like Google Documents) the SrcFsType would be set to "memoryFs". This change fixes the problem by getting the Copy function to pass the src Fs into a variant of Rcat. Fixes #7848
This commit is contained in:
@@ -195,6 +195,7 @@ type MemoryObject struct {
|
||||
modTime time.Time
|
||||
content []byte
|
||||
meta fs.Metadata
|
||||
fs fs.Fs
|
||||
}
|
||||
|
||||
// NewMemoryObject returns an in memory Object with the modTime and content passed in
|
||||
@@ -203,6 +204,7 @@ func NewMemoryObject(remote string, modTime time.Time, content []byte) *MemoryOb
|
||||
remote: remote,
|
||||
modTime: modTime,
|
||||
content: content,
|
||||
fs: MemoryFs,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +221,16 @@ func (o *MemoryObject) Content() []byte {
|
||||
|
||||
// Fs returns read only access to the Fs that this object is part of
|
||||
func (o *MemoryObject) Fs() fs.Info {
|
||||
return MemoryFs
|
||||
return o.fs
|
||||
}
|
||||
|
||||
// SetFs sets the Fs that this memory object thinks it is part of
|
||||
// It will ignore nil f
|
||||
func (o *MemoryObject) SetFs(f fs.Fs) *MemoryObject {
|
||||
if f != nil {
|
||||
o.fs = f
|
||||
}
|
||||
return o
|
||||
}
|
||||
|
||||
// Remote returns the remote path
|
||||
|
Reference in New Issue
Block a user