public Mapper(Animelist list)
        {
            _anidbMappings = new Dictionary<string, AnimelistAnime>();
            _tvdbMappings = new Dictionary<string, List<AnimelistAnime>>();

            int n;
            foreach (var anime in list.Anime.Where(x => int.TryParse(x.TvdbId, out n)))
            {
                _anidbMappings[anime.AnidbId] = anime;

                List<AnimelistAnime> l;
                if (!_tvdbMappings.TryGetValue(anime.TvdbId, out l))
                {
                    l = new List<AnimelistAnime>();
                    _tvdbMappings[anime.TvdbId] = l;
                }

                l.Add(anime);
            }
        }
예제 #2
0
        public Mapper(Animelist list)
        {
            _anidbMappings = new Dictionary <string, AnimelistAnime>();
            _tvdbMappings  = new Dictionary <string, List <AnimelistAnime> >();

            int n;

            foreach (var anime in list.Anime.Where(x => int.TryParse(x.TvdbId, out n)))
            {
                _anidbMappings[anime.AnidbId] = anime;

                List <AnimelistAnime> l;
                if (!_tvdbMappings.TryGetValue(anime.TvdbId, out l))
                {
                    l = new List <AnimelistAnime>();
                    _tvdbMappings[anime.TvdbId] = l;
                }

                l.Add(anime);
            }
        }