Esempio n. 1
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);
 }