From 10c5e4af8e060ed8ecb02ab5e4295219de542289 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Tue, 4 Jul 2017 16:24:46 +0200 Subject: [PATCH] Fixed import --- pages/listimport/listimportanilist/anilist.go | 8 +++++++- pages/listimport/listimportanilist/anilist.pixy | 4 ++-- pages/listimport/listimportanilist/anilist.scarlet | 3 +++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 pages/listimport/listimportanilist/anilist.scarlet diff --git a/pages/listimport/listimportanilist/anilist.go b/pages/listimport/listimportanilist/anilist.go index 35016ff7..f5372148 100644 --- a/pages/listimport/listimportanilist/anilist.go +++ b/pages/listimport/listimportanilist/anilist.go @@ -50,7 +50,13 @@ func findAllMatches(allAnime []*arn.Anime, animeList *arn.AniListAnimeList) []*a matches = importList(matches, allAnime, animeList.Lists.OnHold) matches = importList(matches, allAnime, animeList.Lists.Dropped) - for _, list := range animeList.CustomLists { + custom, ok := animeList.CustomLists.(map[string][]*arn.AniListAnimeListItem) + + if !ok { + return matches + } + + for _, list := range custom { matches = importList(matches, allAnime, list) } diff --git a/pages/listimport/listimportanilist/anilist.pixy b/pages/listimport/listimportanilist/anilist.pixy index b9b57834..51562268 100644 --- a/pages/listimport/listimportanilist/anilist.pixy +++ b/pages/listimport/listimportanilist/anilist.pixy @@ -1,7 +1,7 @@ component ImportAnilist(user *arn.User, matches []*arn.AniListMatch) - h2= "Import: anilist.co" + h2= "anilist.co Import (" + user.Accounts.AniList.Nick + ", " + toString(len(matches)) + " anime)" - table + table.import-list thead tr th anilist.co diff --git a/pages/listimport/listimportanilist/anilist.scarlet b/pages/listimport/listimportanilist/anilist.scarlet new file mode 100644 index 00000000..34b92482 --- /dev/null +++ b/pages/listimport/listimportanilist/anilist.scarlet @@ -0,0 +1,3 @@ +.import-list + max-width table-width-normal + margin 0 auto \ No newline at end of file