fix
This commit is contained in:
parent
148ae646b1
commit
8371121130
2 changed files with 13 additions and 6 deletions
|
|
@ -117,6 +117,9 @@ func (s Server) GetStudio(ctx context.Context, id int64) (*oapi.Studio, error) {
|
|||
oapi_studio.Name = sqlc_studio.StudioName
|
||||
oapi_studio.Description = sqlc_studio.StudioDesc
|
||||
|
||||
if sqlc_studio.IllustID == nil {
|
||||
return &oapi_studio, nil
|
||||
}
|
||||
oapi_illust, err := s.GetImage(ctx, *sqlc_studio.IllustID)
|
||||
if err != nil {
|
||||
return &oapi_studio, fmt.Errorf("GetImage: %v", err)
|
||||
|
|
@ -152,12 +155,14 @@ func (s Server) mapTitle(ctx context.Context, title sqlc.Title) (oapi.Title, err
|
|||
oapi_title.Tags = oapi_tag_names
|
||||
}
|
||||
|
||||
oapi_image, err := s.GetImage(ctx, *title.PosterID)
|
||||
if err != nil {
|
||||
return oapi_title, fmt.Errorf("GetImage: %v", err)
|
||||
}
|
||||
if oapi_image != nil {
|
||||
oapi_title.Poster = oapi_image
|
||||
if title.PosterID != nil {
|
||||
oapi_image, err := s.GetImage(ctx, *title.PosterID)
|
||||
if err != nil {
|
||||
return oapi_title, fmt.Errorf("GetImage: %v", err)
|
||||
}
|
||||
if oapi_image != nil {
|
||||
oapi_title.Poster = oapi_image
|
||||
}
|
||||
}
|
||||
|
||||
oapi_studio, err := s.GetStudio(ctx, title.StudioID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue