feat: title desc handling
This commit is contained in:
parent
57956f1f6e
commit
6d14ac365b
1 changed files with 8 additions and 0 deletions
|
|
@ -73,6 +73,14 @@ func (s Server) mapTitle(title sqlc.GetTitleByIDRow) (oapi.Title, error) {
|
|||
}
|
||||
oapi_title.TitleNames = title_names
|
||||
|
||||
if len(title.TitleDesc) > 0 {
|
||||
title_descs := make(map[string]string, 0)
|
||||
err = json.Unmarshal(title.TitleDesc, &title_descs)
|
||||
if err != nil {
|
||||
return oapi.Title{}, fmt.Errorf("unmarshal TitleDesc: %v", err)
|
||||
}
|
||||
oapi_title.TitleDesc = &title_descs
|
||||
}
|
||||
if len(title.EpisodesLen) > 0 {
|
||||
episodes_lens := make(map[string]float64, 0)
|
||||
err = json.Unmarshal(title.EpisodesLen, &episodes_lens)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue