Exemplo n.º 1
0
        static void Main()
        {
            var profile   = ProfileManager.GetProfile();
            var actorDict = EnterActors();

            var scraper = new ActorScraper(profile);

            scraper.ScrapeActors(actorDict);

            SqlQueries.ActorObjList = scraper.UniqueActors.ToList();

            Database.FillDatabaseInfo(scraper);
            Console.WriteLine("Data transfer complete.", ProfileManager.SuccessColor);
            Console.Write("\r\nActor with most films: ", ProfileManager.ResultColor);
            Database.GetActorWithMostFilms();
            Console.Write("\r\nActor with biggest film rating: ", ProfileManager.ResultColor);
            Database.GetFilmWithBiggestRating();

            if (SqlQueries.ActorObjList.Count > 1)
            {
                Console.WriteLine($"\r\nThe {SqlQueries.ActorObjList.Count} actors Co-Star in all these films:", ProfileManager.ResultColor);
                Database.ActorsAndMovies(SqlQueries.UniversalString());

                if (SqlQueries.ActorObjList.Count > 2)
                {
                    Database.ActorsAndMovies(SqlQueries.CoStarMethod());
                }
            }

            Database.CloseConnections();

            Console.WriteLine("\r\nPress any key to exit...", ProfileManager.InfoColor);
            Console.ReadKey();
        }
Exemplo n.º 2
0
            new ObservableCollection <Film>(); //{new Film("Test Film", 10, "2017", "Cool genre")};

        //TODO: Make this threaded
        public static void SearchActors()
        {
            // Get a dict of actors
            var actorDict = new Dictionary <string, string>();

            foreach (Actor actor in SelectedActors)
            {
                var pair = actorNameToIdPair(actor.Fullname);
                actorDict.Add(pair.Key, pair.Value);
            }

            // Scrape
            var scraper = new ActorScraper();

            scraper.ScrapeActors(actorDict);

            // Update FilmsResult
            FilmsResult.Clear();
            foreach (var film in scraper.GetFilmsInCommon())
            {
                FilmsResult.Add(film);
            }
        }