mirror of https://github.com/Xhofe/alist
fix(baidu_netdisk): update fileToObj to use ServerCtime and ServerMtime (#7535)
parent
2dec756f23
commit
94915b2148
|
@ -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是错误的
|
||||||
|
|
Loading…
Reference in New Issue