Skip to content

Commit

Permalink
fix(baidu_netdisk): update fileToObj to use ServerCtime and ServerMti…
Browse files Browse the repository at this point in the history
…me (#7535)
  • Loading branch information
Kuingsmile authored Nov 21, 2024
1 parent 2dec756 commit 94915b2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/baidu_netdisk/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,20 @@ func fileToObj(f File) *model.ObjThumb {
if f.ServerFilename == "" {
f.ServerFilename = path.Base(f.Path)
}
if f.LocalCtime == 0 {
f.LocalCtime = f.Ctime
if f.ServerCtime == 0 {
f.ServerCtime = f.Ctime
}
if f.LocalMtime == 0 {
f.LocalMtime = f.Mtime
if f.ServerMtime == 0 {
f.ServerMtime = f.Mtime
}
return &model.ObjThumb{
Object: model.Object{
ID: strconv.FormatInt(f.FsId, 10),
Path: f.Path,
Name: f.ServerFilename,
Size: f.Size,
Modified: time.Unix(f.LocalMtime, 0),
Ctime: time.Unix(f.LocalCtime, 0),
Modified: time.Unix(f.ServerMtime, 0),
Ctime: time.Unix(f.ServerCtime, 0),
IsFolder: f.Isdir == 1,

// 直接获取的MD5是错误的
Expand Down

0 comments on commit 94915b2

Please sign in to comment.