Example #1
0
        /// <summary>
        /// Returns a <see cref="MovieCasts"/> for the given <paramref name="id"/>.
        /// </summary>
        /// <param name="id">TMDB id of movie</param>
        /// <returns>Cast and Crew</returns>
        public MovieCasts GetCastCrew(int id)
        {
            string     url    = GetUrl(URL_GETCASTCREW, null, id);
            MovieCasts result = _downloader.Download <MovieCasts>(url);

            return(result);
        }
Example #2
0
        private MovieTag CopyMovieInfos(MovieTag movieTag, Movie movie)
        {
            movieTag.Title   = movie.Title;
            movieTag.IMDB_ID = movie.ImdbId;
            movieTag.TMDB_ID = movie.Id.ToString();

            MovieCollection collection = movie.Collection;

            movieTag.CollectionTitle = collection != null ? collection.Name : null;

            movieTag.ReleaseDate = movie.ReleaseDate.HasValue ? movie.ReleaseDate.Value.ToString("yyyy-MM-dd") : null;
            movieTag.Overview    = movie.Overview;
            movieTag.Tagline     = movie.Tagline;

            //todo: implement certification
            //movieTag.Certification = movie.

            movieTag.Genres = movie.Genres.Select(g => g.Name).ToList().AsReadOnly();


            MovieCasts casts = movieDbApi.GetCastCrew(movie.Id);

            if (casts == null)
            {
                return(movieTag);
            }

            movieTag.Actors    = casts.Cast.Select(p => p.Name).ToList().AsReadOnly();
            movieTag.Directors = casts.Crew.Where(p => p.Job == "Director").Select(p => p.Name).ToList().AsReadOnly();
            movieTag.Writers   = casts.Crew.Where(p => p.Job == "Author").Select(p => p.Name).ToList().AsReadOnly();

            return(movieTag);
        }
 public bool GetMovieCast(int id, out MovieCasts movieCast)
 {
     movieCast = _movieDbHandler.GetCastCrew(id);
     return(movieCast != null);
 }