feat(shared): add centralized helper functions for templates

This commit is contained in:
2026-04-20 16:36:14 +02:00
parent 953e2a067e
commit 436686eed1
3 changed files with 66 additions and 0 deletions

13
web/shared/studio.go Normal file
View File

@@ -0,0 +1,13 @@
package shared
import "mal/integrations/jikan"
// GetProducerName extracts the default title from producer response
func GetProducerName(producer jikan.ProducerResponse) string {
for _, title := range producer.Data.Titles {
if title.Type == "Default" {
return title.Title
}
}
return "Studio"
}