Skip to content

Commit

Permalink
fix(chaoxing): json cannot unmarshal content.uploadDate (close AlistG…
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad authored and EtherealAO committed Apr 12, 2024
1 parent 24d929e commit 2beea54
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/chaoxing/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ type File struct {
Topsort int `json:"topsort"`
Restype string `json:"restype"`
Size int_str `json:"size"`
UploadDate string `json:"uploadDate"`
UploadDate int64 `json:"uploadDate"`
FileSize string `json:"fileSize"`
Name string `json:"name"`
FileID string `json:"fileId"`
Expand Down Expand Up @@ -265,10 +265,7 @@ func fileToObj(f File) *model.Object {
IsFolder: true,
}
}
paserTime, err := time.Parse("2006-01-02 15:04", f.Content.UploadDate)
if err != nil {
paserTime = time.Now()
}
paserTime := time.UnixMilli(f.Content.UploadDate)
return &model.Object{
ID: fmt.Sprintf("%d$%s", f.ID, f.Content.FileID),
Name: f.Content.Name,
Expand Down

0 comments on commit 2beea54

Please sign in to comment.