Skip to content

Commit

Permalink
fix(mal): propagate changes from mal
Browse files Browse the repository at this point in the history
  • Loading branch information
varoOP committed Nov 17, 2024
1 parent 2279e93 commit a9aba20
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion internal/domain/mal.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func ScrapeMal() {
//extensions.Referer(cc)

as := NewAnimeService(cc)
a := GetAnime(AniDBIDPath)
a := updateMalfromAnidb()
as.AnimeSlice = a
r := regexp.MustCompile(`aid=(\d+)`)
as.c.OnHTML("a[href]", func(e *colly.HTMLElement) {
Expand Down Expand Up @@ -166,3 +166,19 @@ func ScrapeMal() {

StoreAnime(as.AnimeSlice, AniDBIDPath)
}

func updateMalfromAnidb() []Anime {
mal := GetAnime(MalIDPath)

for i := range mal {

animeInfo, exists := typeDateMap[mal[i].MalID]
if !exists {
continue
}

mal[i].AnidbID = animeInfo.AnidbID
}

return mal
}

0 comments on commit a9aba20

Please sign in to comment.