Example #1
0
        static Repositories()
        {
            var client          = new WebClient();
            var allRepositories = new List <IRepository>();

            void AddToDictionary(IRepository repo)
            {
                allRepositories.Add(repo);

                var key = repo.RootUri.Host;

                if (!HostToRepoDictionary.ContainsKey(key))
                {
                    HostToRepoDictionary.Add(repo.RootUri.Host, repo);
                }
            }

            //AddToDictionary(new EatMangaRepository(client));
            //AddToDictionary(new MangaDexRepository(client));
            AddToDictionary(new MangaEdenEnRepository(client));
            AddToDictionary(new MangaEdenItRepository(client));
            //AddToDictionary(new MangaKakalotRepository(client));
            AddToDictionary(new MangaNelRepository(client));
            AddToDictionary(new MangaStreamRepository(client));
            //AddToDictionary(new MangaBatRepository(client));
            //AddToDictionary(new SenMangaRepository(client));

            AllRepositories = allRepositories.OrderBy(d => d.Name).ToArray();
        }
Example #2
0
        public static ISeries GetSeriesFromData(Uri uri, string title)
        {
            if (uri == null || string.IsNullOrEmpty(title) || string.IsNullOrWhiteSpace(title))
            {
                return(null);
            }

            if (HostToRepoDictionary.ContainsKey(uri.Host))
            {
                if (HostToRepoDictionary[uri.Host] is RepositoryBase repository)
                {
                    var output = new Series(repository, uri, title);
                    return(output);
                }
            }

            return(null);
        }