use all media list statuses in GetAnimeListByAnimeID

This commit is contained in:
milarin 2023-01-18 10:23:25 +01:00
parent 6cf36a2e55
commit 6abd63d6e0

View File

@ -9,13 +9,13 @@ import (
) )
func GetAnimeListByAnimeID() (map[anilist.MediaID]*anilist.MediaList, error) { func GetAnimeListByAnimeID() (map[anilist.MediaID]*anilist.MediaList, error) {
watchingAnimesChannel, err := GetCurrentlyWatchingAnimes() animeListChannel, err := GetCurrentlyWatchingAnimes(AllMediaListStatuses...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
toMapFunc := func(entry *anilist.MediaList) (anilist.MediaID, *anilist.MediaList) { return entry.MediaID, entry } toMapFunc := func(entry *anilist.MediaList) (anilist.MediaID, *anilist.MediaList) { return entry.MediaID, entry }
return channel.ToMap(watchingAnimesChannel, toMapFunc), nil return channel.ToMap(animeListChannel, toMapFunc), nil
} }
func GetCurrentlyWatchingAnimes(statuses ...anilist.MediaListStatus) (<-chan *anilist.MediaList, error) { func GetCurrentlyWatchingAnimes(statuses ...anilist.MediaListStatus) (<-chan *anilist.MediaList, error) {