♻️ Updated way to setting thumbnail & compressed

This commit is contained in:
2024-12-28 15:42:19 +08:00
parent dda85eae98
commit 845894f12c
4 changed files with 99 additions and 12 deletions

View File

@@ -182,7 +182,7 @@ func TryLinkAttachment(tx *gorm.DB, og models.Attachment, hash string) (bool, er
}
func UpdateAttachment(item models.Attachment) (models.Attachment, error) {
if err := database.C.Updates(&item).Error; err != nil {
if err := database.C.Model(&item).Updates(&item).Error; err != nil {
return item, err
} else {
CacheAttachment(item)