mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-08 21:15:56 +08:00
fix thumb.
This commit is contained in:
parent
50f0f572bc
commit
eaec0e545f
@ -1022,7 +1022,9 @@ video:
|
|||||||
r := binary.NewReader(b)
|
r := binary.NewReader(b)
|
||||||
return &LocalVideoElement{ShortVideoElement: message.ShortVideoElement{ // todo 检查缓存是否有效
|
return &LocalVideoElement{ShortVideoElement: message.ShortVideoElement{ // todo 检查缓存是否有效
|
||||||
Md5: r.ReadBytes(16),
|
Md5: r.ReadBytes(16),
|
||||||
|
ThumbMd5: r.ReadBytes(16),
|
||||||
Size: r.ReadInt32(),
|
Size: r.ReadInt32(),
|
||||||
|
ThumbSize: r.ReadInt32(),
|
||||||
Name: r.ReadString(),
|
Name: r.ReadString(),
|
||||||
Uuid: r.ReadAvailable(),
|
Uuid: r.ReadAvailable(),
|
||||||
}}, nil
|
}}, nil
|
||||||
|
@ -566,7 +566,9 @@ func (bot *CQBot) checkMedia(e []message.IMessageElement) {
|
|||||||
if !global.PathExists(path.Join(global.VIDEO_PATH, filename)) {
|
if !global.PathExists(path.Join(global.VIDEO_PATH, filename)) {
|
||||||
_ = ioutil.WriteFile(path.Join(global.VIDEO_PATH, filename), binary.NewWriterF(func(w *binary.Writer) {
|
_ = ioutil.WriteFile(path.Join(global.VIDEO_PATH, filename), binary.NewWriterF(func(w *binary.Writer) {
|
||||||
w.Write(i.Md5)
|
w.Write(i.Md5)
|
||||||
|
w.Write(i.ThumbMd5)
|
||||||
w.WriteUInt32(uint32(i.Size))
|
w.WriteUInt32(uint32(i.Size))
|
||||||
|
w.WriteUInt32(uint32(i.ThumbSize))
|
||||||
w.WriteString(i.Name)
|
w.WriteString(i.Name)
|
||||||
w.Write(i.Uuid)
|
w.Write(i.Uuid)
|
||||||
}), 0644)
|
}), 0644)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user