fix
All checks were successful
Build and Deploy Go App / build (push) Successful in 17m59s
Build and Deploy Go App / deploy (push) Successful in 3m34s

This commit is contained in:
Iron_Felix 2025-11-18 03:12:16 +03:00
parent 148ae646b1
commit 8371121130
2 changed files with 13 additions and 6 deletions

View file

@ -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)