🐛 fix 189 size and time

pull/548/head
微凉 2021-11-15 20:31:44 +08:00
parent 4466cb19a5
commit 8987958e26
1 changed files with 6 additions and 0 deletions

View File

@ -85,8 +85,14 @@ func (c Cloud189) FormatFile(file *Cloud189File) *model.File {
Thumbnail: file.Icon.SmallUrl,
Url: file.Url,
}
loc, _ := time.LoadLocation("Local")
lastOpTime, err := time.ParseInLocation("2006-01-02 15:04:05", file.LastOpTime, loc)
if err == nil {
f.UpdatedAt = &lastOpTime
}
if file.Size == -1 {
f.Type = conf.FOLDER
f.Size = 0
} else {
f.Type = utils.GetFileType(filepath.Ext(file.Name))
}