diff --git a/gserver/webapp.go b/gserver/webapp.go index 4a87b7a..15f613e 100644 --- a/gserver/webapp.go +++ b/gserver/webapp.go @@ -148,8 +148,8 @@ func GetLEpisode(c *gin.Context) { database.Db.Model(&LP).Related(&AT) var DEP []gin.H for _, EP := range EPs { - if len(EP.Descr.String) > 230 { - ints := []rune(EP.Descr.String) + ints := []rune(EP.Descr.String) + if len(ints) > 230 { EP.Descr.String = string(ints[:230]) + "…" } DEP = append(DEP, gin.H{"EP": EP, "LP": LP,}) @@ -169,8 +169,8 @@ func GetLEpisode(c *gin.Context) { database.Db.Model(&LP).Related(&AT) var DEP []gin.H for _, EP := range EPs { - if len(EP.Descr.String) > 230 { - ints := []rune(EP.Descr.String) + ints := []rune(EP.Descr.String) + if len(ints) > 230 { EP.Descr.String = string(ints[:230]) + "…" } DEP = append(DEP, gin.H{"EP": EP, "LP": LP,})