Skip to content

Commit

Permalink
fix mal title error
Browse files Browse the repository at this point in the history
  • Loading branch information
sonalys committed Feb 8, 2024
1 parent bfeb08c commit 308ac33
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion integrations/anilist/anime_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (api *API) GetCurrentlyWatching(ctx context.Context) ([]AnimeListEntry, err
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
return nil, fmt.Errorf("fetching anime list: %s", string(utils.Must(io.ReadAll(resp.Body))))
return nil, fmt.Errorf("invalid response: %s", string(utils.Must(io.ReadAll(resp.Body))))
}
var entries AnimeListResp
if err := json.NewDecoder(resp.Body).Decode(&entries); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion integrations/myanimelist/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type (

AnimeListEntry struct {
Status ListStatus `json:"status"`
Title string `json:"anime_title"`
Title any `json:"anime_title"`
TitleEng string `json:"anime_title_eng"`
AiringStatus AiringStatus `json:"anime_airing_status"`
}
Expand Down
3 changes: 2 additions & 1 deletion internal/myanimelist/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package myanimelist

import (
"context"
"fmt"
"net/http"
"time"

Expand Down Expand Up @@ -37,7 +38,7 @@ func convertMALEntry(in []myanimelist.AnimeListEntry) []animelist.Entry {
for i := range in {
out = append(out, animelist.Entry{
ListStatus: animelist.ListStatus(in[i].Status),
Titles: []string{in[i].Title, in[i].TitleEng},
Titles: []string{fmt.Sprint(in[i].Title), in[i].TitleEng},
AiringStatus: animelist.AiringStatus(in[i].AiringStatus),
})
}
Expand Down

0 comments on commit 308ac33

Please sign in to comment.