fix(189cloudpc): wrong modified time (close #910)
This commit is contained in:
parent
24d031d578
commit
5295593bf8
@ -229,7 +229,7 @@ func (driver Cloud189) Files(path string, account *model.Account) ([]model.File,
|
|||||||
Size: 0,
|
Size: 0,
|
||||||
Type: conf.FOLDER,
|
Type: conf.FOLDER,
|
||||||
Driver: driver.Config().Name,
|
Driver: driver.Config().Name,
|
||||||
UpdatedAt: MustParseTime(folder.CreateDate),
|
UpdatedAt: MustParseTime(folder.LastOpTime),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
for _, file := range resp.FileListAO.FileList {
|
for _, file := range resp.FileListAO.FileList {
|
||||||
@ -239,7 +239,7 @@ func (driver Cloud189) Files(path string, account *model.Account) ([]model.File,
|
|||||||
Size: file.Size,
|
Size: file.Size,
|
||||||
Type: utils.GetFileType(filepath.Ext(file.Name)),
|
Type: utils.GetFileType(filepath.Ext(file.Name)),
|
||||||
Driver: driver.Config().Name,
|
Driver: driver.Config().Name,
|
||||||
UpdatedAt: MustParseTime(file.CreateDate),
|
UpdatedAt: MustParseTime(file.LastOpTime),
|
||||||
Thumbnail: file.Icon.SmallUrl,
|
Thumbnail: file.Icon.SmallUrl,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -144,8 +144,9 @@ func BoolToNumber(b bool) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func MustParseTime(str string) *time.Time {
|
func MustParseTime(str string) *time.Time {
|
||||||
time, _ := http.ParseTime(str)
|
loc, _ := time.LoadLocation("Local")
|
||||||
return &time
|
lastOpTime, _ := time.ParseInLocation("2006-01-02 15:04:05", str, loc)
|
||||||
|
return &lastOpTime
|
||||||
}
|
}
|
||||||
|
|
||||||
type Params map[string]string
|
type Params map[string]string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user