Пример #1
0
        static void Main(string[] args)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json");

            var configuration = builder.Build();
            var genres        = new Genres(configuration);
            var types         = new Types(configuration);
            var animes        = new Animes(configuration);
            var animeGenres   = new AnimeGenres(configuration);
            var animeStaging  = new AnimeStaging(configuration);
            var stopWatch     = new System.Diagnostics.Stopwatch();

            stopWatch.Start();
            try
            {
                var anime = animeStaging.Read();
                animes.Save(anime);
                animeGenres.Save(anime);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            Console.WriteLine($"Run time: {stopWatch.ElapsedMilliseconds} ms");
        }
Пример #2
0
        static async Task Main(string[] args)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json");

            var configuration = builder.Build();

            System.Net.ServicePointManager.DefaultConnectionLimit = Int32.MaxValue;
            var genres       = new Genres(configuration);
            var types        = new Types(configuration);
            var animes       = new Animes(configuration);
            var animeGenres  = new AnimeGenres(configuration);
            var animeStaging = new AnimeStaging(configuration);
            var stopWatch    = new System.Diagnostics.Stopwatch();

            stopWatch.Start();
            try
            {
                var saves = animeStaging.Read().Select(async(animeAsync) =>
                {
                    var anime = await animeAsync;
                    await animes.Save(anime);
                    await animeGenres.Save(anime.Id, anime.GenreIds);
                });
                await Task.WhenAll(saves);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            Console.WriteLine($"Run time: {stopWatch.ElapsedMilliseconds} ms");
        }
Пример #3
0
 public AnimeGenreStudioQuery(AnimeGenres genre, int page = 1)
 {
     _genre     = genre;
     _page      = page;
     _genreMode = true;
     Request    =
         WebRequest.Create(
             Uri.EscapeUriString($"https://myanimelist.net/anime/genre/{(int) genre}?page={page}"));
     Request.ContentType = "application/x-www-form-urlencoded";
     Request.Method      = "GET";
 }
Пример #4
0
 public AnimeGenreStudioQuery(AnimeGenres genre,int page = 1)
 {
     _genre = genre;
     _page = page;
     _genreMode = true;
     Request =
         WebRequest.Create(
             Uri.EscapeUriString($"https://myanimelist.net/anime/genre/{(int) genre}?page={page}"));
     Request.ContentType = "application/x-www-form-urlencoded";
     Request.Method = "GET";
 }
 public AnimeListPageNavigationArgs(AnimeGenres genre)
 {
     WorkMode = AnimeListWorkModes.AnimeByGenre;
     Genre = genre;
 }
Пример #6
0
 public AnimeListPageNavigationArgs(AnimeGenres genre)
 {
     WorkMode = AnimeListWorkModes.AnimeByGenre;
     Genre    = genre;
 }