Commit 850b678981
Unsigned
Layout: unified · split
internal/anilist.go +2 −1
| @@ -197,7 +197,7 @@ func GetAnimeMalID(anilistMediaID int) (int, error) { | |||
| 197 | return malID, nil | 197 | return malID, nil |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | // Function to get AniList media ID and image | 200 | // This function retrieves the MAL ID and cover image URL for an anime from AniList |
| 201 | func GetAnimeIDAndImage(anilistMediaID int) (int, string, error) { | 201 | func GetAnimeIDAndImage(anilistMediaID int) (int, string, error) { |
| 202 | url := "https://graphql.anilist.co" | 202 | url := "https://graphql.anilist.co" |
| 203 | query := ` | 203 | query := ` |
| @@ -391,6 +391,7 @@ func makePostRequest(url, query string, variables map[string]interface{}, header | |||
| 391 | return nil, fmt.Errorf("failed to create request: %w", err) | 391 | return nil, fmt.Errorf("failed to create request: %w", err) |
| 392 | } | 392 | } |
| 393 | 393 | ||
| 394 | req.Header.Set("Content-Type", "application/json") // <-- Important! | ||
| 394 | for key, value := range headers { | 395 | for key, value := range headers { |
| 395 | req.Header.Set(key, value) | 396 | req.Header.Set(key, value) |
| 396 | } | 397 | } |