Exemplo n.º 1
0
        private void SetMovieInfo(IMDb imdb)
        {
            MovieName = imdb.Title;
            MovieName += imdb.OriginalTitle != "" ? "(" + imdb.OriginalTitle + ")" : "";
            IMDbID = imdb.Id;

            foreach (string s in imdb.Genres)
                Genres.Insert(Genres.Count, s);

            Runtime = imdb.Runtime;
            Rating = Convert.ToDecimal(imdb.Rating);
            Year = Convert.ToInt16(imdb.Year);
            MPAARating = imdb.MpaaRating;
            Storyline = imdb.Storyline.Replace("'", "'");

            if (imdb.Plot.Contains(@"<a href=""plotsummary"">"))
                Plot = imdb.Plot.Substring(0, imdb.Plot.IndexOf(@"<a href=""plotsummary"">")).Replace("&#x27;", "'");
            else
                Plot = imdb.Plot.Replace("&#x27;", "'");

            Posters.Add(imdb.Poster);
            Posters.Add(imdb.PosterSmall);
            Posters.Add(imdb.PosterLarge);
            Posters.Add(imdb.PosterFull);
        }
Exemplo n.º 2
0
        public bool GetMovieName(string fileName, string parentFolder)
        {
            try
            {
                OriginalName = _trim.GetMovieName(fileName);
                IMDb imdb = new IMDb(OriginalName, true);

                if (imdb.Title != "")
                {
                    SetMovieInfo(imdb);
                    return true;
                }

                imdb = new IMDb(parentFolder, true);

                if (imdb.Title != "" && parentFolder != null && parentFolder != "")
                {
                    SetMovieInfo(imdb);
                    return true;
                }

                return false;
            }
            catch (Exception)
            {
                return false;
            }
        }
Exemplo n.º 3
0
        private static void GetMovieInfoImdbScrapping()
        {
            Console.Write("Movie Title: ");
            var movTitle = Console.ReadLine();

            var mov = new IMDb(movTitle, false);

            Console.WriteLine(mov.ImdbURL);
            Console.WriteLine("\nPress Enter...");
            Console.ReadLine();
        }
Exemplo n.º 4
0
        public ActionResult Index(string searchTerm)
        {
            var imdb = new IMDb(searchTerm);

            return View(imdb);
        }
Exemplo n.º 5
0
        private void IMDB_search(string movieName)
        {
            IMDb imdb = new IMDb(movieName);

            StringBuilder description = new StringBuilder();
            description.Append(imdb.Title + "\n");

            description.Append(imdb.Plot + "\n");


            description.Append(imdb.Storyline);

            textBoxDescription.Text = description.ToString();

            StringBuilder str = new StringBuilder();
            for (int i = 0; i < imdb.Genres.Count; ++i)
            {
                str.Append(imdb.Genres[i]);
                if (i != imdb.Genres.Count - 1)
                {
                    str.Append(", ");
                }
            }
            textBoxGenre.Text = str.ToString();
        }
Exemplo n.º 6
0
 private void AddDirector()
 {
     IMDb directorname = new IMDb(MainWindow.searchInput, false);
     System.Console.WriteLine(directorname.Directors[0]);
 }
Exemplo n.º 7
0
        public void setIMDBRating(String movie)
        {
            IMDb moviepicker = new IMDb(movie, false);
                String imdbscore = moviepicker.Rating;
                System.Console.WriteLine(moviepicker.Title);
                finalimdbscore = Decimal.Parse(imdbscore);

            if   (finalimdbscore >= 7.0M)
            {
                Label score = new Label();
                score.Content = (imdbscore);
                score.FontFamily = new FontFamily("Monotype Corsiva");
                score.VerticalContentAlignment = VerticalAlignment.Bottom;
                score.HorizontalContentAlignment = HorizontalAlignment.Center;
                score.FontSize = 46;
                BrushConverter x = new BrushConverter();
                IMDBScorePanel.Background = (Brush)x.ConvertFrom("#66CC33");
                IMDBScorePanel.Children.Add(score);
            }
            else if (finalimdbscore >= 5.0M && finalimdbscore <= 6.9M)
            {
                //Orange Background for Score.
                Label score = new Label();
                score.Content = (imdbscore);
                score.FontFamily = new FontFamily("Monotype Corsiva");
                score.VerticalContentAlignment = VerticalAlignment.Bottom;
                score.HorizontalContentAlignment = HorizontalAlignment.Center;
                score.FontSize = 46;
                BrushConverter x = new BrushConverter();
                IMDBScorePanel.Background = (Brush)x.ConvertFrom("#FFCC33");
                IMDBScorePanel.Children.Add(score);
            }

            else if (finalimdbscore >= 0.0M && finalimdbscore <= 4.9M)
            {
                //Red Background for score.
                Label score = new Label();
                score.Content = (imdbscore);
                score.FontFamily = new FontFamily("Monotype Corsiva");
                score.VerticalContentAlignment = VerticalAlignment.Bottom;
                score.HorizontalContentAlignment = HorizontalAlignment.Center;
                score.FontSize = 46;
                BrushConverter x = new BrushConverter();
                IMDBScorePanel.Background = (Brush)x.ConvertFrom("#FF0000");
                IMDBScorePanel.Children.Add(score);
            }
        }