diff --git a/coolq/cqcode.go b/coolq/cqcode.go index 5f8c956..7cd8c9b 100644 --- a/coolq/cqcode.go +++ b/coolq/cqcode.go @@ -1021,10 +1021,12 @@ video: b, _ := ioutil.ReadFile(rawPath) r := binary.NewReader(b) return &LocalVideoElement{ShortVideoElement: message.ShortVideoElement{ // todo 检查缓存是否有效 - Md5: r.ReadBytes(16), - Size: r.ReadInt32(), - Name: r.ReadString(), - Uuid: r.ReadAvailable(), + Md5: r.ReadBytes(16), + ThumbMd5: r.ReadBytes(16), + Size: r.ReadInt32(), + ThumbSize: r.ReadInt32(), + Name: r.ReadString(), + Uuid: r.ReadAvailable(), }}, nil } else { return &LocalVideoElement{File: rawPath}, nil diff --git a/coolq/event.go b/coolq/event.go index 5b9dd79..86fb713 100644 --- a/coolq/event.go +++ b/coolq/event.go @@ -566,7 +566,9 @@ func (bot *CQBot) checkMedia(e []message.IMessageElement) { if !global.PathExists(path.Join(global.VIDEO_PATH, filename)) { _ = ioutil.WriteFile(path.Join(global.VIDEO_PATH, filename), binary.NewWriterF(func(w *binary.Writer) { w.Write(i.Md5) + w.Write(i.ThumbMd5) w.WriteUInt32(uint32(i.Size)) + w.WriteUInt32(uint32(i.ThumbSize)) w.WriteString(i.Name) w.Write(i.Uuid) }), 0644)