Skip to content

Commit

Permalink
z
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc committed Nov 25, 2024
1 parent 1924c17 commit 1152092
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions openapi/components/subject_v0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ properties:
title: Platform
type: string
description: TV, Web, 欧美剧, DLC...
image:
title: Image
type: string
description: large image url
images:
$ref: "./subject_image.yaml"
infobox:
Expand Down
7 changes: 5 additions & 2 deletions web/res/subject.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ type SubjectTag struct {
type SubjectV0 struct {
Date *string `json:"date"`
Platform *string `json:"platform"`
Image SubjectImages `json:"images"`
Images SubjectImages `json:"images"`
Image *string `json:"image"`
Summary string `json:"summary"`
Name string `json:"name"`
NameCN string `json:"name_cn"`
Expand Down Expand Up @@ -124,10 +125,12 @@ func platformString(s model.Subject) *string {
}

func ToSubjectV0(s model.Subject, totalEpisode int64, metaTags []tag.Tag) SubjectV0 {
images := SubjectImage(s.Image)
return SubjectV0{
TotalEpisodes: totalEpisode,
ID: s.ID,
Image: SubjectImage(s.Image),
Image: &images.Large,
Images: images,
Summary: s.Summary,
Name: s.Name,
Platform: platformString(s),
Expand Down

0 comments on commit 1152092

Please sign in to comment.