♻️ Usermeta, is indexable, thumbnail and more fields on attachments

This commit is contained in:
2024-12-26 21:53:09 +08:00
parent 5bbf13b01e
commit 3a77af23cb
5 changed files with 35 additions and 20 deletions

View File

@@ -2,11 +2,12 @@ package api
import (
"fmt"
"strings"
"git.solsynth.dev/hypernet/paperclip/pkg/internal/gap"
"git.solsynth.dev/hypernet/passport/pkg/authkit"
"github.com/spf13/viper"
"gorm.io/datatypes"
"strings"
"git.solsynth.dev/hypernet/paperclip/pkg/internal/database"
"git.solsynth.dev/hypernet/paperclip/pkg/internal/models"
@@ -26,7 +27,7 @@ func listAttachment(c *fiber.Ctx) error {
needQuery := true
var result = make([]models.Attachment, take)
result := make([]models.Attachment, take)
var idxList []string
if len(c.Query("id")) > 0 {
@@ -73,6 +74,8 @@ func listAttachment(c *fiber.Ctx) error {
tx = tx.Where("ref_id IS NULL")
}
tx = tx.Where("is_indexable != ?", false)
var count int64
countTx := tx
if err := countTx.Model(&models.Attachment{}).Count(&count).Error; err != nil {