Browse Source

Merge pull request 'fix-2046' (#2053) from V20220428.patch into V20220519

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/2053
Reviewed-by: lewis <747342561@qq.com>
tags/v1.22.5.1^2
lewis 3 years ago
parent
commit
3851a780ab
1 changed files with 8 additions and 3 deletions
  1. +8
    -3
      models/cloudbrain_image.go

+ 8
- 3
models/cloudbrain_image.go View File

@@ -45,7 +45,7 @@ type ImageStar struct {
}

type ImageTopic struct {
ID int64
ID int64 `xorm:"pk autoincr"`
Name string `xorm:"UNIQUE VARCHAR(105)"`
ImageCount int
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
@@ -468,8 +468,13 @@ func (images ImageList) loadAttributes(e Engine, uid int64) error {
}

for i := range images {
images[i].UserName = users[images[i].UID].Name
images[i].RelAvatarLink = users[images[i].UID].RelAvatarLink()
if users[images[i].UID] != nil {
images[i].UserName = users[images[i].UID].Name
images[i].RelAvatarLink = users[images[i].UID].RelAvatarLink()
} else {
images[i].UserName = ""
images[i].RelAvatarLink = ""
}
if uid == -1 {
images[i].IsStar = false
} else {


Loading…
Cancel
Save