From af8d6654188523d9be6eea727e3b41e0472acb28 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 29 Dec 2024 02:08:41 +0800 Subject: [PATCH] :bug: Fix opener get wrong dest --- pkg/internal/services/opener.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/internal/services/opener.go b/pkg/internal/services/opener.go index 1509ad9..958437d 100644 --- a/pkg/internal/services/opener.go +++ b/pkg/internal/services/opener.go @@ -89,7 +89,8 @@ func OpenAttachmentByRID(rid string, region ...string) (url string, mimetype str if rawDest == nil { if len(result.Boosts) > 0 { 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 json.Unmarshal(rawDest, &dest) }