Commit 625c335969

625c3359692acfdee45f9514cf04ad4a53902629

parent: 22c5b81107

Unsigned

Wraient <wraient.911@gmail.com> · 2024-10-22 10:57 UTC

Fix: That was hard to debug

Layout: unified · split

internal/anilist.go +6 −2
@@ -28,7 +28,12 @@ func GetAnimeMap(animeList AnimeList) map[string]string {
2828 // Helper function to populate the map from a slice of entries
2929 populateMap := func(entries []Entry) {
3030 for _, entry := range entries {
31 animeMap[strconv.Itoa(entry.Media.ID)] = entry.Media.Title.English
31 // Only include entries with a non-empty English title
32 if entry.Media.Title.English != "" {
33 animeMap[strconv.Itoa(entry.Media.ID)] = entry.Media.Title.English
34 } else {
35 animeMap[strconv.Itoa(entry.Media.ID)] = entry.Media.Title.Romaji
36 }
3237 }
3338 }
3439
@@ -41,7 +46,6 @@ func GetAnimeMap(animeList AnimeList) map[string]string {
4146
4247 return animeMap
4348}
44
4549// SearchAnimeAnilist sends the query to AniList and returns a map of title to ID
4650func SearchAnimeAnilist(query, token string) (map[string]string, error) {
4751 url := "https://graphql.anilist.co"