🎇 optimization googledrive
This commit is contained in:
@ -11,7 +11,7 @@ import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
type GoogleDrive struct {}
|
||||
type GoogleDrive struct{}
|
||||
|
||||
var driverName = "GoogleDrive"
|
||||
|
||||
@ -109,10 +109,13 @@ func (driver GoogleDrive) Files(path string, account *model.Account) ([]model.Fi
|
||||
}
|
||||
|
||||
func (driver GoogleDrive) Link(path string, account *model.Account) (string, error) {
|
||||
file, err := driver.GetFile(utils.ParsePath(path), account)
|
||||
file, err := driver.File(path, account)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if file.Type == conf.FOLDER {
|
||||
return "", drivers.NotFile
|
||||
}
|
||||
link := fmt.Sprintf("https://www.googleapis.com/drive/v3/files/%s?includeItemsFromAllDrives=true&supportsAllDrives=true", file.Id)
|
||||
var e GoogleError
|
||||
_, _ = googleClient.R().SetError(&e).
|
||||
@ -156,4 +159,4 @@ func (driver GoogleDrive) Proxy(c *gin.Context, account *model.Account) {
|
||||
|
||||
func (driver GoogleDrive) Preview(path string, account *model.Account) (interface{}, error) {
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user