👔 Updated collapse post

This commit is contained in:
LittleSheep 2025-04-05 12:12:57 +08:00
parent 69e9a108ef
commit d189c5a8d8
2 changed files with 4 additions and 3 deletions

View File

@ -26,6 +26,10 @@ func NewFlag(post models.Post, account uint) (models.PostFlag, error) {
}
func FlagCalculateCollapseStatus(post models.Post) error {
if post.TotalViews <= 2 {
return nil
}
collapseLimit := 0.5
var flagCount int64

View File

@ -48,9 +48,6 @@ func UniversalPostFilter(c *fiber.Ctx, tx *gorm.DB, cfg ...UniversalPostFilterCo
if c.QueryBool("noReply", true) && !config.ShowReply {
tx = FilterPostReply(tx)
}
if c.QueryBool("noCollapse", true) && !config.ShowCollapsed {
tx = tx.Where("is_collapsed = ? OR is_collapsed IS NULL", false)
}
if len(c.Query("author")) > 0 {
var author models.Publisher