Merge branch 'dev-ars' of ssh://meowgit.nekoea.red:22222/nihonium/nyanimedb into dev-ars

This commit is contained in:
Iron_Felix 2025-11-17 03:56:27 +03:00
commit abf09e5f5e

View file

@ -11,6 +11,7 @@ import (
)
func Word2Sqlc(s *string) *string {
// TODO: merge two ifs
if s == nil {
return nil
}
@ -69,6 +70,7 @@ func (s Server) GetTagsByTitleId(ctx context.Context, id int64) (oapi.Tags, erro
return nil, fmt.Errorf("query GetTitleTags: %v", err)
}
// TODO: check if underlying slice initialized as nil
var oapi_tag_names oapi.Tags
for _, title_tag := range sqlc_title_tags {
var oapi_tag_name map[string]string
@ -91,6 +93,7 @@ func (s Server) GetImage(ctx context.Context, id int64) (oapi.Image, error) {
return oapi_image, fmt.Errorf("query GetImageByID: %v", err)
}
// TODO: clearer comment
//can cast and dont use brain cause all this fiels required
oapi_image.Id = &sqlc_image.ID
oapi_image.ImagePath = &sqlc_image.ImagePath
@ -101,7 +104,7 @@ func (s Server) GetImage(ctx context.Context, id int64) (oapi.Image, error) {
}
func (s Server) GetStudio(ctx context.Context, id int64) (oapi.Studio, error) {
// TODO: check all possibly nil fields
var oapi_studio oapi.Studio
sqlc_studio, err := s.db.GetStudioByID(ctx, id)
@ -123,6 +126,7 @@ func (s Server) GetStudio(ctx context.Context, id int64) (oapi.Studio, error) {
}
func (s Server) mapTitle(ctx context.Context, title sqlc.Title) (oapi.Title, error) {
// TODO: check all possibly nil fields
var oapi_title oapi.Title
var title_names map[string][]string