🐛 Fix opener get wrong dest

This commit is contained in:
LittleSheep 2024-12-29 02:08:41 +08:00
parent 1955d94414
commit af8d665418

View File

@ -89,7 +89,8 @@ func OpenAttachmentByRID(rid string, region ...string) (url string, mimetype str
if rawDest == nil { if rawDest == nil {
if len(result.Boosts) > 0 { if len(result.Boosts) > 0 {
randomIdx := rand.IntN(len(result.Boosts)) randomIdx := rand.IntN(len(result.Boosts))
if des, ok := DestinationsByIndex[randomIdx]; ok { boost := result.Boosts[randomIdx]
if des, ok := DestinationsByIndex[boost.Destination]; ok {
rawDest = des.Raw rawDest = des.Raw
json.Unmarshal(rawDest, &dest) json.Unmarshal(rawDest, &dest)
} }