diff --git a/handler/artwork.go b/handler/artwork.go index 956cd4f..95e06e2 100644 --- a/handler/artwork.go +++ b/handler/artwork.go @@ -151,7 +151,7 @@ func (p *PixivClient) GetRelatedArtworks(id string) ([]models.IllustShort, error Illusts []models.IllustShort `json:"illusts"` } - URL := fmt.Sprintf(ArtworkCommentsURL, id) + URL := fmt.Sprintf(ArtworkRelatedURL, id, 96) response, err := p.PixivRequest(URL) if err != nil { diff --git a/models/models.go b/models/models.go index 8a2d6c8..1497029 100644 --- a/models/models.go +++ b/models/models.go @@ -93,24 +93,25 @@ type FrequentTag struct { } type Illust struct { - ID string `json:"id"` - Title string `json:"title"` - Description template.HTML `json:"description"` - UserID string `json:"userId"` - UserName string `json:"userName"` - UserAccount string `json:"userAccount"` - Date time.Time `json:"uploadDate"` - Images []Image `json:"images"` - Tags []Tag `json:"tags"` - Pages int `json:"pageCount"` - Bookmarks int `json:"bookmarkCount"` - Likes int `json:"likeCount"` - Comments int `json:"commentCount"` - Views int `json:"viewCount"` - XRestrict xRestrict `json:"xRestrict"` - AiType aiType `json:"aiType"` - User UserShort - RecentWorks []IllustShort + ID string `json:"id"` + Title string `json:"title"` + Description template.HTML `json:"description"` + UserID string `json:"userId"` + UserName string `json:"userName"` + UserAccount string `json:"userAccount"` + Date time.Time `json:"uploadDate"` + Images []Image `json:"images"` + Tags []Tag `json:"tags"` + Pages int `json:"pageCount"` + Bookmarks int `json:"bookmarkCount"` + Likes int `json:"likeCount"` + Comments int `json:"commentCount"` + Views int `json:"viewCount"` + CommentDisabled int `json:"commentOff"` + XRestrict xRestrict `json:"xRestrict"` + AiType aiType `json:"aiType"` + User UserShort + RecentWorks []IllustShort } type IllustShort struct { diff --git a/template/artwork.jet.html b/template/artwork.jet.html index 90c5c23..9de8ce4 100644 --- a/template/artwork.jet.html +++ b/template/artwork.jet.html @@ -50,7 +50,11 @@
The creator turned comments off
+ {{ else if Illust.Comments == 0 }} +There is no comment yet
+ {{ else }} {{ range Comments }}