🐛 fix lanzou webdav time error

pull/548/head
微凉 2021-12-01 00:15:34 +08:00
parent cd50227835
commit bd91acc5d0
1 changed files with 9 additions and 6 deletions

View File

@ -10,6 +10,7 @@ import (
"path/filepath" "path/filepath"
"regexp" "regexp"
"strconv" "strconv"
"time"
) )
var lanzouClient = resty.New() var lanzouClient = resty.New()
@ -25,12 +26,14 @@ type LanZouFile struct {
} }
func (driver *Lanzou) FormatFile(file *LanZouFile) *model.File { func (driver *Lanzou) FormatFile(file *LanZouFile) *model.File {
now := time.Now()
f := &model.File{ f := &model.File{
Id: file.Id, Id: file.Id,
Name: file.Name, Name: file.Name,
Driver: driver.Config().Name, Driver: driver.Config().Name,
SizeStr: file.Size, SizeStr: file.Size,
TimeStr: file.Time, TimeStr: file.Time,
UpdatedAt: &now,
} }
if file.Folder { if file.Folder {
f.Type = conf.FOLDER f.Type = conf.FOLDER
@ -146,7 +149,7 @@ func (driver *Lanzou) GetFilesByUrl(account *model.Account) ([]LanZouFile, error
pg++ pg++
files = append(files, resp.Text...) files = append(files, resp.Text...)
} }
return files,nil return files, nil
} }
//type LanzouDownInfo struct { //type LanzouDownInfo struct {