From 7e76c28396b161f187ef56b6b9ac23e25f60e9a2 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Tue, 23 Jun 2026 17:32:13 +0200 Subject: [PATCH] refactor: remove display methods from anime type --- integrations/jikan/types.go | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/integrations/jikan/types.go b/integrations/jikan/types.go index 4e8ae4f1..8eb50465 100644 --- a/integrations/jikan/types.go +++ b/integrations/jikan/types.go @@ -185,40 +185,6 @@ type RecommendationsResponse struct { Data []RecommendationEntry `json:"data"` } -// ScoredByFormatted returns formatted count (e.g. "1 234 567"). -func (a Anime) ScoredByFormatted() string { - return formatNumber(a.ScoredBy) -} - -// MembersFormatted returns formatted count (e.g. "1 234 567"). -func (a Anime) MembersFormatted() string { - return formatNumber(a.Members) -} - -// FavoritesFormatted returns formatted count (e.g. "1 234 567"). -func (a Anime) FavoritesFormatted() string { - return formatNumber(a.Favorites) -} - -// formatNumber adds space separators to a number (1234567 -> "1 234 567"). -func formatNumber(n int) string { - if n == 0 { - return "" - } - s := fmt.Sprintf("%d", n) - var res []string - for i := len(s); i > 0; i -= 3 { - start := max(i-3, 0) - res = append([]string{s[start:i]}, res...) - } - return strings.Join(res, " ") -} - -// ImageURL returns the webp large image URL for the anime. -func (a Anime) ImageURL() string { - return a.Images.Webp.LargeImageURL -} - // ShortRating extracts just the rating code (e.g. "PG-13") from full rating string. func (a Anime) ShortRating() string { if a.Rating == "" {