mirror of
https://github.com/rclone/rclone.git
synced 2024-11-24 08:14:25 +08:00
gofile: fix failed downloads on newly uploaded objects
The upload routine no longer returns a url to download the object. This fixes the problem by fetching it if necessary when we attempt to Open the object.
This commit is contained in:
parent
796013dd06
commit
3f7651291b
|
@ -1469,6 +1469,13 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read
|
|||
if o.id == "" {
|
||||
return nil, errors.New("can't download - no id")
|
||||
}
|
||||
if o.url == "" {
|
||||
// On upload an Object is returned with no url, so fetch it here if needed
|
||||
err = o.readMetaData(ctx)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("read metadata: %w", err)
|
||||
}
|
||||
}
|
||||
fs.FixRangeOption(options, o.size)
|
||||
var resp *http.Response
|
||||
opts := rest.Opts{
|
||||
|
|
Loading…
Reference in New Issue
Block a user