mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 07:29:35 +01:00
jottacloud: return direct download link from rclone link command
If the shared path is a directory, then the download will be a zip archive. Fixes #5391 See #5399
This commit is contained in:
parent
78db3dba0e
commit
b868561951
@ -368,6 +368,7 @@ type JottaFile struct {
|
||||
XMLName xml.Name
|
||||
Name string `xml:"name,attr"`
|
||||
Deleted Flag `xml:"deleted,attr"`
|
||||
PublicURI string `xml:"publicURI"`
|
||||
PublicSharePath string `xml:"publicSharePath"`
|
||||
State string `xml:"currentRevision>state"`
|
||||
CreatedAt Time `xml:"currentRevision>created"`
|
||||
|
@ -1261,15 +1261,23 @@ func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration,
|
||||
return "", errors.Wrap(err, "couldn't create public link")
|
||||
}
|
||||
if unlink {
|
||||
if result.PublicSharePath != "" {
|
||||
return "", errors.Errorf("couldn't remove public link - %q", result.PublicSharePath)
|
||||
if result.PublicURI != "" {
|
||||
return "", errors.Errorf("couldn't remove public link - %q", result.PublicURI)
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
if result.PublicSharePath == "" {
|
||||
return "", errors.New("couldn't create public link - no link path received")
|
||||
if result.PublicURI == "" {
|
||||
return "", errors.New("couldn't create public link - no uri received")
|
||||
}
|
||||
return joinPath(baseURL, result.PublicSharePath), nil
|
||||
if result.PublicSharePath != "" {
|
||||
webLink := joinPath(baseURL, result.PublicSharePath)
|
||||
fs.Debugf(nil, "Web link: %s", webLink)
|
||||
} else {
|
||||
fs.Debugf(nil, "No web link received")
|
||||
}
|
||||
directLink := joinPath(baseURL, fmt.Sprintf("opin/io/downloadPublic/%s/%s", f.user, result.PublicURI))
|
||||
fs.Debugf(nil, "Direct link: %s", directLink)
|
||||
return directLink, nil
|
||||
}
|
||||
|
||||
// About gets quota information
|
||||
|
Loading…
Reference in New Issue
Block a user