fix(baidu_netdisk): update fileToObj to use ServerCtime and ServerMtime (#7535)

pull/7551/head v3.40.0
Kuingsmile 2024-11-21 22:41:23 +08:00 committed by GitHub
parent 2dec756f23
commit 94915b2148
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 6 deletions

View File

@ -56,11 +56,11 @@ func fileToObj(f File) *model.ObjThumb {
if f.ServerFilename == "" { if f.ServerFilename == "" {
f.ServerFilename = path.Base(f.Path) f.ServerFilename = path.Base(f.Path)
} }
if f.LocalCtime == 0 { if f.ServerCtime == 0 {
f.LocalCtime = f.Ctime f.ServerCtime = f.Ctime
} }
if f.LocalMtime == 0 { if f.ServerMtime == 0 {
f.LocalMtime = f.Mtime f.ServerMtime = f.Mtime
} }
return &model.ObjThumb{ return &model.ObjThumb{
Object: model.Object{ Object: model.Object{
@ -68,8 +68,8 @@ func fileToObj(f File) *model.ObjThumb {
Path: f.Path, Path: f.Path,
Name: f.ServerFilename, Name: f.ServerFilename,
Size: f.Size, Size: f.Size,
Modified: time.Unix(f.LocalMtime, 0), Modified: time.Unix(f.ServerMtime, 0),
Ctime: time.Unix(f.LocalCtime, 0), Ctime: time.Unix(f.ServerCtime, 0),
IsFolder: f.Isdir == 1, IsFolder: f.Isdir == 1,
// 直接获取的MD5是错误的 // 直接获取的MD5是错误的