Skip to content

Commit 3fcb9c0

Browse files
author
wcr
committed
时间取LocalMtime,避免多次上传同一个文件时,因为时间不同需要重新上传
1 parent ef1bf47 commit 3fcb9c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/baidu_netdisk/baidu_netdisk.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,15 +634,15 @@ func (f *Fs) itemToDirOrObject(ctx context.Context, dir string, info *api.Item)
634634
dir = dir + "/"
635635
}
636636
if info.IsDir == 1 {
637-
entry = NewDir(f, dir+info.ServerFilename, time.Unix(info.ServerMtime, 0)).SetID(strconv.Itoa(int(info.FsID))).SetItems(-1).SetSize(-1)
637+
entry = NewDir(f, dir+info.ServerFilename, time.Unix(info.LocalMtime, 0)).SetID(strconv.Itoa(int(info.FsID))).SetItems(-1).SetSize(-1)
638638
} else if info.IsDir == 0 {
639639
entry = &Object{
640640
fs: f,
641641
remote: dir + info.ServerFilename,
642642
hasMetaData: true,
643643
isOneNoteFile: false,
644644
size: info.Size,
645-
modTime: time.Unix(info.ServerMtime, 0),
645+
modTime: time.Unix(info.LocalMtime, 0),
646646
id: strconv.Itoa(int(info.FsID)),
647647
hash: "md5",
648648
mimeType: "json",

0 commit comments

Comments
 (0)