From 5295593bf87dce3070a19652fd561cddc2f6ff6c Mon Sep 17 00:00:00 2001 From: Xhofe Date: Wed, 6 Apr 2022 17:58:57 +0800 Subject: [PATCH] fix(189cloudpc): wrong modified time (close #910) --- drivers/189pc/driver.go | 4 ++-- drivers/189pc/util.go | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/189pc/driver.go b/drivers/189pc/driver.go index c256267b..b6ca7a1b 100644 --- a/drivers/189pc/driver.go +++ b/drivers/189pc/driver.go @@ -229,7 +229,7 @@ func (driver Cloud189) Files(path string, account *model.Account) ([]model.File, Size: 0, Type: conf.FOLDER, Driver: driver.Config().Name, - UpdatedAt: MustParseTime(folder.CreateDate), + UpdatedAt: MustParseTime(folder.LastOpTime), }) } for _, file := range resp.FileListAO.FileList { @@ -239,7 +239,7 @@ func (driver Cloud189) Files(path string, account *model.Account) ([]model.File, Size: file.Size, Type: utils.GetFileType(filepath.Ext(file.Name)), Driver: driver.Config().Name, - UpdatedAt: MustParseTime(file.CreateDate), + UpdatedAt: MustParseTime(file.LastOpTime), Thumbnail: file.Icon.SmallUrl, }) } diff --git a/drivers/189pc/util.go b/drivers/189pc/util.go index 4f5d2baa..c31e98e8 100644 --- a/drivers/189pc/util.go +++ b/drivers/189pc/util.go @@ -144,8 +144,9 @@ func BoolToNumber(b bool) int { } func MustParseTime(str string) *time.Time { - time, _ := http.ParseTime(str) - return &time + loc, _ := time.LoadLocation("Local") + lastOpTime, _ := time.ParseInLocation("2006-01-02 15:04:05", str, loc) + return &lastOpTime } type Params map[string]string