Skip to content

Commit

Permalink
update: 升级lgrgo版本,完善视频封面
Browse files Browse the repository at this point in the history
  • Loading branch information
Redmomn committed Aug 29, 2024
1 parent bfa9e6e commit a409d62
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
14 changes: 8 additions & 6 deletions coolq/cqcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -1037,12 +1037,14 @@ func (bot *CQBot) readImageCache(b []byte, sourceType message.SourceType) (messa
func (bot *CQBot) readVideoCache(b []byte) message.IMessageElement {
r := binary.NewReader(b)
return &message.ShortVideoElement{ // todo 检查缓存是否有效
Md5: r.ReadBytes(16),
ThumbMd5: r.ReadBytes(16),
Size: r.ReadU32(),
ThumbSize: r.ReadU32(),
Name: r.ReadStringWithLength("u32", true),
Uuid: r.ReadBytes(r.Len()),
Md5: r.ReadBytes(16),
Size: r.ReadU32(),
Thumb: &message.VideoThumb{
Md5: r.ReadBytes(16),
Size: r.ReadU32(),
},
Name: r.ReadStringWithLength("u32", true),
Uuid: r.ReadBytes(r.Len()),
}
}

Expand Down
4 changes: 2 additions & 2 deletions coolq/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,9 @@ func (bot *CQBot) checkMedia(e []message.IMessageElement, sourceID int64) {
case *message.ShortVideoElement:
data := binary.NewWriterF(func(w *binary.Builder) {
w.Write(i.Md5)
w.Write(i.ThumbMd5)
w.Write(i.Thumb.Md5)
w.WriteU32(i.Size)
w.WriteU32(i.ThumbSize)
w.WriteU32(i.Thumb.Size)
w.WritePacketString(i.Name, "u32", true)
w.Write(i.Uuid)
})
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.20

require (
github.com/FloatTech/sqlite v1.6.3
github.com/LagrangeDev/LagrangeGo v0.0.0-20240829010317-08c3e5126856
github.com/LagrangeDev/LagrangeGo v0.0.0-20240829120425-ba9282a7f7de
github.com/Microsoft/go-winio v0.6.2-0.20230724192519-b29bbd58a65a
github.com/RomiChan/syncx v0.0.0-20240418144900-b7402ffdebc7
github.com/RomiChan/websocket v1.4.3-0.20220227141055-9b2c6168c9c5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ github.com/FloatTech/sqlite v1.6.3 h1:MQkqBNlkPuCoKQQgoNLuTL/2Ci3tBTFAnVYBdD0Wy4
github.com/FloatTech/sqlite v1.6.3/go.mod h1:zFbHzRfB+CJ+VidfjuVbrcin3DAz283F7hF1hIeHzpY=
github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1 h1:g4pTnDJUW4VbJ9NvoRfUvdjDrHz/6QhfN/LoIIpICbo=
github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1/go.mod h1:fHZFWGquNXuHttu9dUYoKuNbm3dzLETnIOnm1muSfDs=
github.com/LagrangeDev/LagrangeGo v0.0.0-20240829010317-08c3e5126856 h1:/Cu9PVv85qFRQ7i6rleLogDt0odh78bnlt2JoT5HJYs=
github.com/LagrangeDev/LagrangeGo v0.0.0-20240829010317-08c3e5126856/go.mod h1:qK/l75YuMYdJWfPcxPhfjybJdXD4kzMFvcbKlvdAoa0=
github.com/LagrangeDev/LagrangeGo v0.0.0-20240829120425-ba9282a7f7de h1:CHSQMwurtk5oQG27krJL4NBlGAFqYIDXQIiapnqhlbw=
github.com/LagrangeDev/LagrangeGo v0.0.0-20240829120425-ba9282a7f7de/go.mod h1:qK/l75YuMYdJWfPcxPhfjybJdXD4kzMFvcbKlvdAoa0=
github.com/Microsoft/go-winio v0.6.2-0.20230724192519-b29bbd58a65a h1:aU1703IHxupjzipvhu16qYKLMR03e+8WuNR+JMsKfGU=
github.com/Microsoft/go-winio v0.6.2-0.20230724192519-b29bbd58a65a/go.mod h1:OZqLNXdYJHmx7aqq/T6wAdFEdoGm5nmIfC4kU7M8P8o=
github.com/RomiChan/protobuf v0.1.1-0.20230204044148-2ed269a2e54d h1:/Xuj3fIiMY2ls1TwvPKmaqQrtJsPY+c9s+0lOScVHd8=
Expand Down

0 comments on commit a409d62

Please sign in to comment.