feat(shared): add centralized helper functions for templates
This commit is contained in:
13
web/shared/studio.go
Normal file
13
web/shared/studio.go
Normal 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"
|
||||
}
|
||||
Reference in New Issue
Block a user