mirror of https://github.com/Xhofe/alist
perf(123):file thumbnail
parent
3b59bb5c09
commit
aeb2297f1f
|
@ -47,6 +47,7 @@ func (driver Pan123) FormatFile(file *File) *model.File {
|
||||||
Size: file.Size,
|
Size: file.Size,
|
||||||
Driver: driver.Config().Name,
|
Driver: driver.Config().Name,
|
||||||
UpdatedAt: file.UpdateAt,
|
UpdatedAt: file.UpdateAt,
|
||||||
|
Thumbnail: file.DownloadUrl,
|
||||||
}
|
}
|
||||||
f.Type = file.GetType()
|
f.Type = file.GetType()
|
||||||
return f
|
return f
|
||||||
|
@ -66,7 +67,7 @@ func (driver Pan123) GetFiles(parentId string, account *model.Account) ([]File,
|
||||||
"parentFileId": parentId,
|
"parentFileId": parentId,
|
||||||
"trashed": "false",
|
"trashed": "false",
|
||||||
}
|
}
|
||||||
_, err := driver.Request("https://www.123pan.com/api/file/list",
|
_, err := driver.Request("https://www.123pan.com/api/file/list/new",
|
||||||
base.Get, nil, query, nil, &resp, false, account)
|
base.Get, nil, query, nil, &resp, false, account)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -126,7 +126,7 @@ func (driver Pan123) Files(path string, account *model.Account) ([]model.File, e
|
||||||
_ = base.SetCache(path, rawFiles, account)
|
_ = base.SetCache(path, rawFiles, account)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
files := make([]model.File, 0)
|
files := make([]model.File, 0, len(rawFiles))
|
||||||
for _, file := range rawFiles {
|
for _, file := range rawFiles {
|
||||||
files = append(files, *driver.FormatFile(&file))
|
files = append(files, *driver.FormatFile(&file))
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
package _23
|
package _23
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Xhofe/alist/conf"
|
|
||||||
"github.com/Xhofe/alist/utils"
|
|
||||||
"path"
|
"path"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/Xhofe/alist/conf"
|
||||||
|
"github.com/Xhofe/alist/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type File struct {
|
type File struct {
|
||||||
|
@ -15,6 +16,7 @@ type File struct {
|
||||||
Type int `json:"Type"`
|
Type int `json:"Type"`
|
||||||
Etag string `json:"Etag"`
|
Etag string `json:"Etag"`
|
||||||
S3KeyFlag string `json:"S3KeyFlag"`
|
S3KeyFlag string `json:"S3KeyFlag"`
|
||||||
|
DownloadUrl string `json:"DownloadUrl"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f File) GetSize() uint64 {
|
func (f File) GetSize() uint64 {
|
||||||
|
|
Loading…
Reference in New Issue