🐛 Only apply active boost

This commit is contained in:
2024-12-29 12:23:41 +08:00
parent c6944cd3df
commit a58f44d50e
2 changed files with 11 additions and 2 deletions

View File

@@ -52,13 +52,12 @@ func OpenAttachmentByRID(rid string, region ...string) (url string, mimetype str
Preload("Pool").
Preload("Thumbnail").
Preload("Compressed").
Preload("Boosts").
First(&attachment).Error; err != nil {
return
}
var boosts []models.AttachmentBoost
boosts, err = ListBoostByAttachment(attachment.ID)
boosts, err = ListBoostByAttachmentWithStatus(attachment.ID, models.BoostStatusActive)
if err != nil {
return
}