Example #1
0
 public void CastSearchFromMovie(BLL.Movie movie)
 {
     CastSimpleFromMovie(movie);
     VoteAverage  = movie.VoteAverage;
     Metascore    = movie.Metascore;
     TomatoRating = movie.TomatoRating;
 }
Example #2
0
        public async Task <Movie> GetMovieByIdFromAPI(string id)
        {
            MovieRepository repo = new MovieRepository();
            var             IMDB = new TMDbClient("2c54085e8a7f520650d65cb78a48555a");
            var             pom  = await IMDB.GetMovieAsync(id, MovieMethods.Credits | MovieMethods.Videos | MovieMethods.Similar | MovieMethods.Reviews | MovieMethods.Keywords);

            var newMovie = new BLL.Movie
            {
                IMDbId      = pom.ImdbId,
                Title       = pom.Title,
                Runtime     = pom.Runtime,
                Credits     = pom.Credits,
                Genres      = pom.Genres,
                Keywords    = pom.Keywords,
                Overview    = pom.Overview,
                Popularity  = pom.Popularity,
                PosterPath  = pom.PosterPath,
                ReleaseDate = pom.ReleaseDate,
                Reviews     = pom.Reviews,
                Similar     = pom.Similar,
                Status      = pom.Status,
                Videos      = pom.Videos,
                VoteAverage = pom.VoteAverage,
                VoteCount   = pom.VoteCount
            };

            newMovie = repo.OMDbData(newMovie);
            newMovie = repo.SubtitleData(newMovie);
            return(newMovie);
        }
Example #3
0
 public void CastSimpleFromMovie(BLL.Movie movie)
 {
     Title  = movie.Title;
     IMDBID = movie.IMDbId;
     if (movie.PosterPath == "" || movie.PosterPath == null)
     {
         PosterURL = null;
     }
     else
     {
         PosterURL = "http://image.tmdb.org/t/p/w185" + movie.PosterPath;
     }
 }
Example #4
0
        public void AddMovie(BLL.Movie movie)
        {
            var data = new Movie
            {
                Title       = movie.Title,
                ReleaseYear = movie.ReleaseYear
            };

            if (movie.Genre != null)
            {
                if (_movieContext.Genres.Find(movie.Genre.Id) is Genre genre)
                {
                    data.Genre = genre;
                }
                else
                {
                    data.Genre = new Genre {
                        Name = movie.Genre.Name
                    };
                }
            }
            _movieContext.Add(data);
            _movieContext.SaveChanges();
        }
Example #5
0
 public void AddMovie(BLL.Movie movie)
 {
     throw new NotImplementedException();
 }
Example #6
0
        public void CastFromMovie(BLL.Movie movie)
        {
            CastSimpleFromMovie(movie);

            TrailerURL = BLL.MovieRepository.GetYTURLForMovie(movie);

            if (movie.Runtime != null)
            {
                Runtime = movie.Runtime.Value;
            }
            else
            {
                Runtime = 0;
            }
            Genres = "";
            foreach (var genre in movie.Genres)
            {
                Genres += genre.Name + ", ";
            }
            Keywords = "";
            if (movie.Keywords != null)
            {
                foreach (var keyword in movie.Keywords.Keywords)
                {
                    Keywords += keyword.Name + ", ";
                }
            }
            Overview    = movie.Overview;
            Popularity  = movie.Popularity;
            ReleaseDate = movie.ReleaseDate;
            Status      = movie.Status;
            VoteAverage = movie.VoteAverage;
            VoteCount   = movie.VoteCount;

            FBLikes          = movie.FBLikes;
            FBShares         = movie.FBShares;
            Rated            = movie.Rated;
            Language         = movie.Language;
            Country          = movie.Country;
            Awards           = movie.Awards;
            Metascore        = movie.Metascore;
            TomatoRating     = movie.TomatoRating;
            TomatoReviews    = movie.TomatoReviews;
            TomatoFresh      = movie.TomatoFresh;
            TomatoRotten     = movie.TomatoRotten;
            TomatoUserMeter  = movie.TomatoUserMeter;
            TomatoUserRating = movie.TomatoUserRating;

            Crew = new Dictionary <string, string>();
            int i = 1;

            foreach (var crew in movie.Credits.Crew)
            {
                if (Crew.Keys.Contains(crew.Job))
                {
                    Crew.Add(crew.Job + i.ToString(), crew.Name);
                    i++;
                }
                else
                {
                    Crew.Add(crew.Job, crew.Name);
                }
            }

            Cast = new Dictionary <string, string>();
            foreach (var cast in movie.Credits.Cast)
            {
                Cast.Add(cast.Name, cast.Character);
            }

            if (movie.MovieSubtitle != null)
            {
                SubtitleDownloadLink = movie.MovieSubtitle.SubTitleDownloadLink.ToString();
                SubtitlePageLink     = movie.MovieSubtitle.SubtitlePageLink.ToString();
            }
        }
Example #7
0
 public void CastSimpleFromMovie(BLL.Movie movie)
 {
     Title     = movie.Title;
     IMDBID    = movie.IMDbId;
     PosterURL = "http://image.tmdb.org/t/p/w185" + movie.PosterPath;
 }
Example #8
0
 public bool EditMovie(BLL.Movie movie) => throw new NotImplementedException();