feat: title desc handling
All checks were successful
Build and Deploy Go App / build (push) Successful in 6m11s
Build and Deploy Go App / deploy (push) Successful in 44s

This commit is contained in:
Iron_Felix 2025-12-05 23:37:13 +03:00
parent 57956f1f6e
commit 6d14ac365b

View file

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