예제 #1
0
        public Movie Translate(OmDbMovieResponse @object)
        {
            if (@object == null)
            {
                return(Movie.Empty);
            }

            var movieInfo = MovieInfo.New(
                @object.Title,
                @object.Year,
                @object.Rated,
                @object.Runtime,
                TranslateGenres(@object.Genre),
                @object.Released,
                @object.Country);

            var directors = TranslateDirectors(@object.Director);
            var writers   = TranslateWriters(@object.Writer);
            var actors    = TranslateActors(@object.Actors);

            var plot     = Plot.New(@object.Plot);
            var language = Language.New(@object.Language);
            var awards   = Awards.New(@object.Awards);
            var poster   = Poster.New(@object.Poster);
            var imdbInfo = ImdbInfo.New(@object.ImdbId, @object.ImdbVotes, @object.ImdbRating);

            return(Movie.New(
                       movieInfo,
                       directors,
                       writers,
                       actors,
                       plot,
                       language,
                       awards,
                       poster,
                       imdbInfo));
        }