Example #1
0
        private void frmInformation_Load(object sender, EventArgs e)
        {
            //Gets well, the info
            List<String> countries = new List<String>();
            myPoster = API.GetMovieImages(movieID, "en");
            myMovie = API.GetMovieInfo(movieID);
            txtTitle.Text = myMovie.title;
            txtYear.Text = myMovie.release_date.ToString();

            //Don't know if there works for all movies......
            try
            {
                picPoster.ImageLocation = "http://image.tmdb.org/t/p/w185" + myPoster.posters[0].file_path;
            }
            catch (ArgumentException)
            {
                picPoster.ImageLocation = "noposter.jpg";
            }

            richTextBox1.Text = myMovie.overview;
            lstActors.DataSource = API.GetMovieCast(movieID).cast;

            //Craziness to just get the rating but makes sense
            foreach (ReleaseCountry elements in API.GetMovieReleases(movieID).countries)
            {
                countries.Add(elements.certification);
                txtRating.Text = countries[0];
            }
            //Crew members, really I only wanted director but this works, the more info the better I guess ^_^
            foreach (Crew members in API.GetMovieCast(movieID).crew)
            {
                lstCrew.Items.Add(members.job + ": " + members.name);
            }
        }
Example #2
0
        private void frmInformation_Load(object sender, EventArgs e)
        {
            //Gets well, the info
            List <String> countries = new List <String>();

            myPoster      = API.GetMovieImages(movieID, "en");
            myMovie       = API.GetMovieInfo(movieID);
            txtTitle.Text = myMovie.title;
            txtYear.Text  = myMovie.release_date.ToString();

            //Don't know if there works for all movies......
            try
            {
                picPoster.ImageLocation = "http://image.tmdb.org/t/p/w185" + myPoster.posters[0].file_path;
            }
            catch (ArgumentException)
            {
                picPoster.ImageLocation = "noposter.jpg";
            }

            richTextBox1.Text    = myMovie.overview;
            lstActors.DataSource = API.GetMovieCast(movieID).cast;

            //Craziness to just get the rating but makes sense
            foreach (ReleaseCountry elements in API.GetMovieReleases(movieID).countries)
            {
                countries.Add(elements.certification);
                txtRating.Text = countries[0];
            }
            //Crew members, really I only wanted director but this works, the more info the better I guess ^_^
            foreach (Crew members in API.GetMovieCast(movieID).crew)
            {
                lstCrew.Items.Add(members.job + ": " + members.name);
            }
        }
Example #3
0
        private void GetPosters(Job job)
        {
            MakeProgress("Getting poster images...");

            foreach (var movie in job.Movies)
            {
                var tmdbMovieImages = new TmdbMovieImages();

                try
                {
                    if (string.IsNullOrEmpty(_rootImageUrl))
                    {
                        _rootImageUrl = GetConfiguration().images.base_url + "original";
                    }
                    tmdbMovieImages = _tmdbApi.GetMovieImages(movie.Id, null);
                    var posterLanguages = (tmdbMovieImages.posters.Select(poster => poster.iso_639_1).ToList());
                    posterLanguages = posterLanguages.Distinct().ToList();

                    if (posterLanguages.Count == 0)
                    {
                        tmdbMovieImages = _tmdbApi.GetMovieImages(movie.Id, "en");
                    }
                }
                catch (Exception ex)
                {
                    HandleTmdbError(ex);
                }

                if (tmdbMovieImages == null)
                    continue;

                foreach (var poster in tmdbMovieImages.posters)
                {
                    poster.file_path = _rootImageUrl + poster.file_path;

                    if (movie.CoverArtImages.OfType<RemoteCoverArt>().All(x => x.Uri != poster.file_path))
                    {
                        movie.CoverArtImages.Add(new RemoteCoverArt
                        {
                            Uri = _rootImageUrl + poster.file_path,
                            Language = Language.FromCode(poster.iso_639_1)
                        });
                    }
                }
            }
        }