use all media list statuses in GetAnimeListByAnimeID
This commit is contained in:
parent
6cf36a2e55
commit
6abd63d6e0
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user