コード例 #1
0
 protected override void ExecuteInsertPerformanceCommand(string[] commandWords)
 {
     var venue = this.GetVenue(commandWords[5]);
     switch (commandWords[2])
     {
         case "movie":
             var movie = new Movie(
                 commandWords[3],
                 decimal.Parse(commandWords[4]),
                 venue,
                 DateTime.Parse(commandWords[6] + " " + commandWords[7]));
             this.Performances.Add(movie);
             break;
         case "theatre":
             var theatre = new Theatre(
                 commandWords[3],
                 decimal.Parse(commandWords[4]),
                 venue,
                 DateTime.Parse(commandWords[6] + " " + commandWords[7]));
             this.Performances.Add(theatre);
             break;
         case "concert":
             var concert = new Concert(
                 commandWords[3],
                 decimal.Parse(commandWords[4]),
                 venue,
                 DateTime.Parse(commandWords[6] + " " + commandWords[7]));
             this.Performances.Add(concert);
             break;
         default:
             break;
     }
 }
コード例 #2
0
ファイル: TestDataAccessLayer.cs プロジェクト: rodde1981/test
 public Movie InsertMovieIntoDatabase(Movie m)
 {
     Movie savedMovie = _movieDal.Save(m);
     Assert.IsNotNull(savedMovie.Id);
     Assert.AreNotEqual(0, savedMovie.Id);
     return savedMovie;
 }
コード例 #3
0
ファイル: NewMovie.aspx.cs プロジェクト: nancy-bree/MyMovies
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     bool isAlreadyExists;
     using (var context = new MyMoviesContext())
     {
         var movie = new Movie
         {
             Title = tbTitle.Text,
             Year = Int32.Parse(tbYear.Text),
             Genre = context.Genres.Find(Int32.Parse(ddlGenre.SelectedItem.Value))
         };
         isAlreadyExists = context.Movies.FirstOrDefault(x => x.Title == movie.Title && x.Year == movie.Year && x.GenreId == movie.Genre.Id) != null;
         if (!isAlreadyExists)
         {
             context.Movies.Add(movie);
             context.SaveChanges();
         }
     }
     if (isAlreadyExists)
     {
         Response.Redirect(Request.Url.AbsoluteUri.Substring(0,
             Request.Url.AbsoluteUri.Count() - Request.Url.Query.Count()) + "?movieAction=exist");
     }
     else
     {
         Response.Redirect("~/Default.aspx");
     }
 }
コード例 #4
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (NavigationContext.QueryString.ContainsKey("idx") && NavigationContext.QueryString.ContainsKey("type"))
            {
                int.TryParse(NavigationContext.QueryString["idx"].ToString(), out movieIdx);
                movieType = NavigationContext.QueryString["type"].ToString();

                if (movieType == "now")
                {
                    this.movie = AppSettings.Instance.Storage.NowMovies[movieIdx];
                }
                else if (movieType == "upcoming")
                {
                    this.movie = AppSettings.Instance.Storage.UpcomingMovies[movieIdx];
                }
                AppSettings.Instance.Storage.GetExtendMovieInformation(movie, (resultMovie) =>
                {
                    this.movie = resultMovie;

                    Deployment.Current.Dispatcher.BeginInvoke(() =>
                    {
                        UpdateDescription();
                        UpdateImageCollection();
                    });
                });

                PanoramaControl.Title = this.movie.Title;
                PanoramaControl.DefaultItem = PanoramaDescriprionItem;

            }
        }
コード例 #5
0
        protected override void OnAddItem(Movie video, bool select)
        {
            var found = false;
            LogManager.Log("Adding items to Veritcal gallery");
            foreach (Control c in this.tableLayoutPanel.Controls)
            {
                var widget = c as LinkViewWidget;
                if (widget != null)
                {
                    var link = widget.Video as MovieLink;
                    if(link.DowloadUrl == video.Url)
                    {
                        widget.SelectView();
                        found = true;
                    }
                    else
                        widget.DeselectView();
                }
            }
            if (!found)
            {
                foreach (var link in video.Links)
                {
                    var widget = AddItem(link);
                    //this.tableLayoutPanel.Controls.SetChildIndex(widget, 0);
                }

                if (select)
                {
                    var widget = this.tableLayoutPanel.Controls[0] as LinkViewWidget;
                    widget.SelectView();
                }
            }
        }
コード例 #6
0
 protected override void OnAddItem(Movie movie, bool select)
 {
     var found = false;
     LogManager.Log("Adding items to Veritcal gallery");
     foreach (Control c in this.flowLayoutPanel.Controls)
     {
         var widget = c as WebViewWidget;
         if (widget != null)
         {
             var link = widget.Video;
             if (link.ID == movie.ID)
             {
                 widget.SelectView();
                 found = true;
             }
             else
                 widget.DeselectView();
         }
     }
     if (!found)
     {
         var m = this.currentPage.Videos.FirstOrDefault(x => x.ID == movie.ID);
         if (m != null)
             this.currentPage.Videos.Remove(m);
         this.currentPage.Videos.Insert(this.startIndex, movie);
         AddSinglePage();
         if (select)
             ((WebViewWidget)this.flowLayoutPanel.Controls[0]).SelectView();
      }
 }
コード例 #7
0
		protected override void OnCreate (Bundle savedInstanceState) {
			base.OnCreate (savedInstanceState);

			// Set our view from the "main" layout resource
			this.SetContentView (Resource.Layout.movie_detail);

			// Create your application here
			var strConfig = this.Intent.Extras.GetString ("Configuration");
			var strSelectedMovie = this.Intent.Extras.GetString ("SelectedMovie");
			this.configuration = JsonConvert.DeserializeObject<ConfigurationResponse> (strConfig);
			this.movieDetail = JsonConvert.DeserializeObject<Movie> (strSelectedMovie);

			this.btnPlay = this.FindViewById<Button> (Resource.Id.movie_detail_btnPlay);
			this.btnPlay.Click += this.btnPlay_Click;
			this.btnFavorite = this.FindViewById<Button> (Resource.Id.movie_detail_btnFavorite);
			this.btnFavorite.Click += this.btnFavorite_Click;
			this.btnClose = this.FindViewById<ImageButton> (Resource.Id.movie_detail_close);
			this.btnClose.Click += this.btnClose_Click;
			this.txtTitle = this.FindViewById<TextView> (Resource.Id.movie_detail_txtTitle);
			this.txtReleaseDate = this.FindViewById<TextView> (Resource.Id.movie_detail_txtReleaseDate);
			this.ratingBar = this.FindViewById<RatingBar> (Resource.Id.movie_detail_ratingBar);
			this.txtVoteCount = this.FindViewById<TextView> (Resource.Id.movie_detail_txtVoteCount);
			this.txtOverview = this.FindViewById<TextView> (Resource.Id.movie_detail_txtOverview);
			this.imgPoster = this.FindViewById<ImageView> (Resource.Id.movie_detail_imgPoster);
			this.vwSimilarMovies = this.FindViewById<RelativeLayout> (Resource.Id.movie_detail_vwSimilarMovies);
			this.movieList = this.FindViewById<RecyclerView>(Resource.Id.movie_detail_lstSimilarMovies);
			this.movieLayoutManager = new LinearLayoutManager (this, LinearLayoutManager.Horizontal, false);
			this.movieList.SetLayoutManager (this.movieLayoutManager);

			this.updateLayout ();
		}
コード例 #8
0
ファイル: MoviePage.xaml.cs プロジェクト: Filmap/filmap-wp8
        private async Task ChangeButtonsStatuses(Movie movie)
        {
            //MessageBox.Show("movie");

            HttpClient httpClient = new HttpClient();
            httpClient.BaseAddress = new Uri((App.Current as App).filmapApiUrl);

            var response = await httpClient.GetAsync("/films/" + movie.imdbID + "?token=" + (App.Current as App).accessToken);
            var str = response.Content.ReadAsStringAsync().Result;

            try
            {
                FilmapFilm film = JsonConvert.DeserializeObject<FilmapFilm>(str);

                if (film.watched == 1)
                {
                    button1.Content = "Watched";
                    button1.IsEnabled = false;
                    button.IsEnabled = false;
                }
                else if (film.watched == 0)
                {
                    button.IsEnabled = false;
                    button.Content = "Watch later";
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }

        }
コード例 #9
0
ファイル: lwf_text.cs プロジェクト: yonekawa/lwf
        public Text(LWF lwf, Movie p, int objId, int instId = -1)
            : base(lwf, p, Format.Object.Type.TEXT, objId)
        {
            Format.Text text = lwf.data.texts[objId];
            m_dataMatrixId = text.matrixId;

            if (text.nameStringId != -1) {
            m_name = lwf.data.strings[text.nameStringId];
            } else {
            if (instId >= 0 && instId < lwf.data.instanceNames.Length) {
                int stringId = lwf.GetInstanceNameStringId(instId);
                if (stringId != -1)
                    m_name = lwf.data.strings[stringId];
            }
            }

            TextRenderer textRenderer =
            lwf.rendererFactory.ConstructText(lwf, objId, this);

            string t = null;
            if (text.stringId != -1)
            t = lwf.data.strings[text.stringId];

            if (text.nameStringId == -1 && string.IsNullOrEmpty(name)) {
            if (text.stringId != -1)
                textRenderer.SetText(t);
            } else {
            lwf.SetTextRenderer(p.GetFullName(), name, t, textRenderer);
            }

            m_renderer = textRenderer;
        }
コード例 #10
0
ファイル: lwf_bitmapclip.cs プロジェクト: rayyee/lwf
        public BitmapClip(LWF lwf, Movie parent, int objId)
            : base(lwf, parent, objId)
        {
            m_dataMatrixId = lwf.data.bitmaps[objId].matrixId;
            var data = lwf.data.bitmaps[objId];
            var fragment = lwf.data.textureFragments[data.textureFragmentId];
            var texdata = lwf.data.textures[fragment.textureId];
            width = fragment.w / texdata.scale;
            height = fragment.h / texdata.scale;
            m_renderer = lwf.rendererFactory.ConstructBitmap(lwf, objId, this);

            depth = -1;
            visible = true;

            regX = 0;
            regY = 0;
            x = 0;
            y = 0;
            scaleX = 0;
            scaleY = 0;
            rotation = 0;
            alpha = 1;

            _scaleX = scaleX;
            _scaleY = scaleY;
            _rotation = rotation;
            _cos = 1;
            _sin = 0;

            _matrix = new Matrix();
        }
コード例 #11
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;
        }
コード例 #12
0
ファイル: StartClass.cs プロジェクト: jpisoard/myrepository
        static void Main()
        {
            try {
                Configuration configuration = new Configuration();
                configuration.AddAssembly(typeof (Movie).Assembly);
                ISessionFactory SessionFactory = configuration.BuildSessionFactory();
                ISession session = SessionFactory.OpenSession();

                using (ITransaction transaction = session.BeginTransaction())
                {
                    Movie movie = new Movie();
                    movie.Title = "SpiderMan";
                    movie.Author = "Warner";
                    session.Save(movie);
                    transaction.Commit();
                }

                IQuery query = session.CreateQuery("FROM Movie");
                IList<Movie> movies = query.List<Movie>();
                Debug.WriteLine("count" + movies.Count);
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.StackTrace);
            }
        }
コード例 #13
0
 public Character(string name, Movie movie, Actor actor)
     : this()
 {
     Name = name;
     Movie = movie;
     Actor = actor;
 }
コード例 #14
0
ファイル: TestDataAccessLayer.cs プロジェクト: rodde1981/test
 public void Setup()
 {
     _movieDal = new MovieDal();
     _gameDal = new GameDal();
     _movie = new Movie("TestRulle1", 15, MediaFormat.BlueRay, new DateTime(2001,01,01));
     _game = new Game("Halo", 15, MediaFormat.Dvd, GameSystemEnum.Xbox, new DateTime(2001, 01, 01));
 }
コード例 #15
0
ファイル: lwf_bitmapclip.cs プロジェクト: DelSystem32/lwf
	public BitmapClip(LWF lwf, Movie parent, int objId)
		: base(lwf, parent, objId)
	{
		var data = lwf.data.bitmaps[objId];
		var fragment = lwf.data.textureFragments[data.textureFragmentId];
		var texdata = lwf.data.textures[fragment.textureId];
		width = fragment.w / texdata.scale;
		height = fragment.h / texdata.scale;
		offsetX = fragment.x;
		offsetY = fragment.y;
		originalWidth = fragment.ow;
		originalHeight = fragment.oh;

		depth = -1;
		visible = true;

		regX = 0;
		regY = 0;
		x = 0;
		y = 0;
		scaleX = 0;
		scaleY = 0;
		rotation = 0;
		alpha = 1;

		_scaleX = scaleX;
		_scaleY = scaleY;
		_rotation = rotation;
		_cos = 1;
		_sin = 0;

		_matrix = new Matrix();
	}
コード例 #16
0
        public void AddMovie_should_add_the_movie_to_the_collection()
        {
            var movie = new Movie(1, "Test");
            _collection.AddMovie(movie);

            _collection.Movies.Should().Contain(movie);
        }
コード例 #17
0
        public MovieEditorWindowViewModel(IMovieEditorWindow view, Movie movie, MovieRepository repository)
        {
            if (movie == null)
            {
                createMode = true;
                movie = new Movie();
            }

            this.view = view;
            this.repository = repository;
            Movie = movie;

            Genres = new ObservableCollection<Genre>(repository.GetGenres());
            AgeLimits = repository.GetAgeLimits().ToList();

            if (createMode) return;

            var limit = AgeLimits.FirstOrDefault(_ => _.Id == movie.AgeLimit.Id);
            view.SelectedAgeLimitIndex = AgeLimits.IndexOf(limit);

            var selectedGenres = Genres.Join(movie.Genres,
                genre => genre.Id,
                genre => genre.Id,
                (genre1, genre2) => genre1).ToList();

            selectedGenres.ForEach(_ => _.IsSelected = true);
        }
コード例 #18
0
ファイル: FakeStorage.cs プロジェクト: kimtz/CIKMovies
 public void Remove(Movie movie)
 {
     if (_movies.Contains(movie))
     {
         _movies.Remove(movie);
     }
 }
コード例 #19
0
        public IHttpActionResult PutMovie(int id, Movie movie)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != movie.Id)
            {
                return BadRequest();
            }

            db.Entry(movie).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MovieExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
コード例 #20
0
        public void GenresTest() {
            //Upload a file
            MemoryStream s = new MemoryStream();
            s.WriteByte(5);
            int tmpId = db.UploadFile(s);
            //Create a movie with genres horror, comedy and action
            IList<string> expectedGenres = new List<string> { "Horror", "Comedy", "Action" };
            Movie mov = new Movie()
            {
                Title = "title",
                Year = 1900,
                BuyPrice = 1000,
                RentPrice = 100,
                Description = "description"
            };
            Movie movie = db.CreateMovie(1, tmpId, expectedGenres, mov, new List<string>{"director"});
            
            //Retrieve the movie from the database and check that the genres match the inserted
            Movie actMovie = db.GetMovie(movie.Id);
            IList<string> actualGenres = actMovie.Genres;
            Assert.AreEqual(expectedGenres.Count, actualGenres.Count);
            foreach (string genre in expectedGenres) {
                Assert.IsTrue(actualGenres.Contains(genre));
            }

            db.DeleteMovie(movie.Id, 1);
        }
コード例 #21
0
ファイル: ImdbEvents.cs プロジェクト: bnayae/SDP-2015
 public void LikeMovie(Movie movie)
 {
     Console.ForegroundColor = ConsoleColor.Yellow;
     Console.WriteLine($"Movie: {movie.Name} ({movie.Year}) by {movie.Sender.Name} \r\n\t{movie.Sender.ImageUrl}");
     Console.WriteLine();
     Console.ResetColor();
 }
コード例 #22
0
        public Task<IEnumerable<Movie>> ParseListResponse(string response)
        {
            return Task.Run<IEnumerable<Movie>>(() =>
            {
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(response);
                var nodeList = doc.SelectNodes("//result");
                var result = new List<Movie>();

                for (var i = 0; i < nodeList.Count; i++)
                {
                    var node = nodeList[i];
                    var movie = new Movie();
                    movie.SourceId = node.Attributes["imdbID"].Value;
                    movie.Title = node.Attributes["Title"].Value;
                    movie.CoverUrl = node.Attributes["Poster"] == null ? string.Empty : node.Attributes["Poster"].Value;
                    movie.Source = Models.Source.OMDB;
                    int releaseYear;
                    if (int.TryParse(node.Attributes["Year"].Value, out releaseYear))
                    {
                        movie.ReleaseYear = releaseYear;
                    }
                    result.Add(movie);
                }
                return result;
            });
        }
コード例 #23
0
ファイル: FilmsDAL_EF.cs プロジェクト: tscherkas/filmsWebApp
 public Film createOrUpdateFilm(Film film)
 {
     if(film.ID != null && film.ID != new Guid("00000000-0000-0000-0000-000000000000"))
     {
         var movie = model.Movie.Find(film.ID);
         movie.OriginalTitle = film.name;
         movie.ReleaseDate = film.date;
         model.Entry(movie).State = EntityState.Modified;
         model.SaveChanges();
     }
     else
     {
         var movie = new Movie
         {
             OriginalTitle = film.name,
             RussianTitle = "",
             ReleaseDate = film.date,
             MovieId = Guid.NewGuid()
         };
         model.Movie.Add(movie);
         model.SaveChanges();
         film.ID = movie.MovieId;
     }
     return film;
 }
コード例 #24
0
ファイル: WMCDataManager.cs プロジェクト: evihalf/metafetch
 public static XDocument GenerateIDXML(Movie movie, string[] idparts)
 {
     return new XDocument(
         new XElement("Disc",
             new XElement("Name", movie.Name),
             new XElement("ID", idparts[0] + "|" + idparts[1])));
 }
コード例 #25
0
ファイル: MoviesDAL.cs プロジェクト: jlschuma/ServiceTest
        public List<Movie> GetMovies()
        {
            List<Movie> moviesList = new List<Movie>();
            try
            {
                using (conn)
                {
                    conn = new SqlConnection(connString);

                    string sqlSelectString = "select title, director, year_made from Movies";
                    command = new SqlCommand(sqlSelectString, conn);
                    command.Connection.Open();

                    SqlDataReader reader = command.ExecuteReader();
                    while (reader.Read())
                    {
                        Movie movie = new Movie();
                        movie.Title = reader[0].ToString();
                        movie.DirectorId = Convert.ToInt16(reader[1]);
                        movie.YearMade = Convert.ToInt16(reader[2]);
                        moviesList.Add(movie);
                    }
                    return moviesList;
                }

            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                command.Connection.Close();
            }
        }
コード例 #26
0
ファイル: VideoViewController.cs プロジェクト: jjabney/lucid
        public void PlayVideo(Movie movie)
        {
            if (_player == null)
            {
                _player = new MPMoviePlayerController();
                //_player.ControlStyle = MPMovieControlStyle.Fullscreen;
                _player.SourceType = MPMovieSourceType.Streaming;
                _player.Fullscreen = true;

                var center = NSNotificationCenter.DefaultCenter;
                _preloadObserver = center.AddObserver(NOTIFICATION_PRELOAD_FINISH,
                                                      (notify)=>{

                    _player.Play();
                    notify.Dispose();
                });

                _playbackObserver = center.AddObserver(NOTIFICATION_PLAYBLACK_FINISH,
                                                       (notify)=>{

                    notify.Dispose();

                });

                var f = this.View.Frame;
                _player.View.Frame = new Rectangle(0,0,(int)f.Width,(int)f.Height);
                this.Add(_player.View);
            }

            var url = NSUrl.FromString(movie.Url);
            _player.ContentUrl = url;
            _player.Play();
        }
コード例 #27
0
        public ActionResult Create(MovieViewModel model)
        {
            var maleActor = db.Actors.Find(model.LeadingMaleRoleId);
            var femaleActor = db.Actors.Find(model.LeadingFemaleRoleId);
            var studio = db.Studios.Find(model.StudioId);

            if (maleActor != null && femaleActor != null && studio != null)
            {
                var movie = new Movie();
                movie.Title = model.Title;
                movie.Year = model.Year;
                movie.Director = model.Director;
                movie.LeadingMaleRole = maleActor;
                movie.LeadingFemaleRole = femaleActor;
                movie.Studio = studio;

                if (ModelState.IsValid)
                {
                    db.Movies.Add(movie);
                    db.SaveChanges();
                    return RedirectToAction("Index");
                }
            }

            ViewBag.MaleActors = db.Actors.ToList().Where(a => a.Gender == Gender.Male).Select(a => new SelectListItem { Text = a.Name, Value = a.Id.ToString() });
            ViewBag.FemaleActors = db.Actors.ToList().Where(a => a.Gender == Gender.Female).Select(a => new SelectListItem { Text = a.Name, Value = a.Id.ToString() });
            ViewBag.Studios = db.Studios.ToList().Select(s => new SelectListItem { Text = s.Name, Value = s.Id.ToString() });

            return PartialView("_CreateMovie", model);
        }
コード例 #28
0
ファイル: Form1.cs プロジェクト: tamerboncooglu/XmlSerialize
        private void button1_Click(object sender, EventArgs e)
        {
            var movie = new Movie()
                {
                    Director = txtDirector.Text,
                    Name = txtName.Text,
                    Title = txtTitle.Text,
                    Year = txtYear.Text
                };

            settings.Movies.Add(movie);

            settings.UserInfo = new UserInfo
                {
                    Email = txtEmail.Text,
                    Password = txtPassword.Text
                };

            SerializeToXML(settings);

            MessageBox.Show("Kayıt Oluşturuldu");

            txtDirector.Clear();
            txtName.Clear();
            txtTitle.Clear();
            txtYear.Clear();

            Form1_Load(null, null);
        }
コード例 #29
0
ファイル: MoviesController.cs プロジェクト: Vyara/SciHub
        public ActionResult Movies_Create([DataSourceRequest]DataSourceRequest request, MovieAdminViewModel model)
        {
            if (ModelState.IsValid && model != null)
            {
                //var movie = Mapper.Map<Movie>(model);
                var newId = 7;
                var movie = new Movie()
                {
                    Title = model.Title,
                    Year = model.Year,
                    PosterId = model.PosterId,
                    DirectorId = model.DirectorId,
                    StudioId = model.StudioId,
                    Summary = model.Summary,
                    CreatedOn = model.CreatedOn,
                    ModifiedOn = model.ModifiedOn,
                    IsDeleted = model.IsDeleted,
                    DeletedOn = model.DeletedOn

                };

                var result = this.movies.Add(movie);
                newId = movie.Id;
                Mapper.Map(result, model);
            }

            return Json(new[] { model }.ToDataSourceResult(request, ModelState));
        }
コード例 #30
0
        public ActionResult Suggestion(Movie movie)
        {
            var movieSuggestions = new Core.ServiceBus.Topic.MovieSuggestions();
            movieSuggestions.Send(movie);

            return RedirectToAction("Index", "Home");
        }
コード例 #31
0
        public void DeleteMovie(int movieId)
        {
            Movie movie = _movies.FirstOrDefault(x => x.Id == movieId);

            _movies.Remove(movie);
        }
コード例 #32
0
 public Movie Create(Movie movie)
 {
     context.Movies.Add(movie);
     return(movie);
 }
コード例 #33
0
        public IHttpActionResult Put(UserMovieModel data)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Invalid Data"));
            }

            if (data.UserId < 0)
            {
                return(BadRequest("Invalid UserId"));
            }

            if (data.MovieId < 0)
            {
                return(BadRequest("Invalid MovieId"));
            }

            if (data.UserRating < 0)
            {
                return(BadRequest("Invalid Rating"));
            }

            DbResult <UserMovie> res = _userMovieRep.GetSingle(data.UserId, data.MovieId);

            if (!res.IsSuccess)
            {
                DbResult <UserMovie> resIns = _userMovieRep.Insert(new UserMovie
                {
                    MovieId    = data.MovieId,
                    UserId     = data.UserId,
                    UserRating = data.UserRating
                });
                if (!resIns.IsSuccess)
                {
                    return(BadRequest("UserId or MovieId does not exist in the system"));
                }
            }
            else
            {
                DbResult <int> resUpd = _userMovieRep.Update(new UserMovie
                {
                    MovieId    = data.MovieId,
                    UserId     = data.UserId,
                    UserRating = data.UserRating
                });
                if (!resUpd.IsSuccess)
                {
                    return(InternalServerError(new System.Exception(resUpd.Message)));
                }
            }

            var     ratings     = _userMovieRep.GetAllByMovieId(data.MovieId).Result;
            decimal totalrating = 0;

            foreach (var item in ratings)
            {
                if (item.UserRating.HasValue)
                {
                    totalrating += item.UserRating.Value;
                }
            }
            decimal average = totalrating / ratings.Count;

            Movie entMovie = _movieRep.GetSingle(data.MovieId).Result;

            entMovie.AverageRating = average;
            DbResult <int> resMov = _movieRep.Update(entMovie);

            if (!resMov.IsSuccess)
            {
                return(InternalServerError(new System.Exception(resMov.Message)));
            }

            var returnValue = new MovieApiModel
            {
                id            = entMovie.MovieId,
                title         = entMovie.Title,
                yearOfRelease = entMovie.YearOfRelease,
                runningTime   = entMovie.RunningTime,
                genres        = entMovie.Genres,
                averageRating = Math.Round(average * 2, MidpointRounding.AwayFromZero) / 2
            };

            return(Ok(returnValue));
        }
コード例 #34
0
        public async Task Add(Movie movie)
        {
            await _unitOfWork.Movie.AddAsync(movie);

            await _unitOfWork.CommitAsync();
        }
コード例 #35
0
        // GET: Movie/Details/5
        public ActionResult Details(int id)
        {
            Movie Result = MyMovies.Single(mm => mm.MovieId == id);

            return(View(Result));
        }
コード例 #36
0
        public ActionResult Delete(int?id)
        {
            var movieObj = new Movie().DeleteMovie(id);

            return(View("Index", "Movie"));
        }
コード例 #37
0
 public void Delete(Movie movie)
 {
     _context.Movies.Remove(movie);
 }
コード例 #38
0
 public IActionResult MyMovies(Movie formsubmission)
 {
     //Returns the edit move view
     return(View("EditMovie", formsubmission));
 }
コード例 #39
0
 public void Put([FromBody] Movie movie)
 {
     _repo.Update(movie.ID, movie);
 }
コード例 #40
0
 public void Post([FromBody] Movie movie)
 {
     _repo.Add(movie);
 }
コード例 #41
0
        // GET: Movie/Edit/5
        public ActionResult Edit(int id)
        {
            Movie m = ms.GetMovieById(id);

            return(View(m));
        }
コード例 #42
0
ファイル: MovieDbContext.cs プロジェクト: snys98/conventions
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            var movie1 = new Movie {
                Id = Guid.NewGuid(), Title = "Johnny English Strikes Again", Genre = "Action/Adventure", ReleaseDateUtc = DateTime.Parse("10/12/2018 00:00:00Z")
            };
            var movie2 = new Movie {
                Id = Guid.NewGuid(), Title = "A Star Is Born", Genre = "Drama/Romance", ReleaseDateUtc = DateTime.Parse("10/04/2018 00:00:00Z")
            };

            modelBuilder.Entity <Actor>().HasData(
                new Actor {
                Id = Guid.NewGuid(), CountryCode = "UK", Name = "Rowan Atkinson", MovieId = movie1.Id
            },
                new Actor {
                Id = Guid.NewGuid(), CountryCode = "FR", Name = "Olga Kurylenko", MovieId = movie1.Id
            },
                new Actor {
                Id = Guid.NewGuid(), CountryCode = "US", Name = "Jake Lacy", MovieId = movie1.Id
            },
                new Actor {
                Id = Guid.NewGuid(), CountryCode = "US", Name = "Bradley Cooper", MovieId = movie2.Id
            },
                new Actor {
                Id = Guid.NewGuid(), CountryCode = "US", Name = "Lady Gaga", MovieId = movie2.Id
            },
                new Actor {
                Id = Guid.NewGuid(), CountryCode = "US", Name = "Sam Elliott", MovieId = movie2.Id
            },
                new Actor {
                Id = Guid.NewGuid(), CountryCode = "US", Name = "Andrew Dice Clay", MovieId = movie2.Id
            },
                new Actor {
                Id = Guid.NewGuid(), CountryCode = "US", Name = "Dave Chappelle", MovieId = movie2.Id
            },
                new Actor {
                Id = Guid.NewGuid(), CountryCode = "US", Name = "Rebecca Field", MovieId = movie2.Id
            },
                new Actor {
                Id = Guid.NewGuid(), CountryCode = "US", Name = "Michael Harney", MovieId = movie2.Id
            },
                new Actor {
                Id = Guid.NewGuid(), CountryCode = "US", Name = "Rafi Gavron", MovieId = movie2.Id
            },
                new Actor {
                Id = Guid.NewGuid(), CountryCode = "US", Name = "Willam Belli", MovieId = movie2.Id
            },
                new Actor {
                Id = Guid.NewGuid(), CountryCode = "US", Name = "Halsey", MovieId = movie2.Id
            });

            modelBuilder.Entity <Country>().HasData(
                new Country {
                Code = "UK", Name = "United Kingdom"
            },
                new Country {
                Code = "FR", Name = "France"
            },
                new Country {
                Code = "US", Name = "United States"
            });

            modelBuilder.Entity <Movie>().HasData(movie1, movie2);
        }
コード例 #43
0
        protected override void Seed(Pop.ly.Models.ApplicationDbContext context)
        {
            //  This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method 
            //  to avoid creating duplicate seed data.

            //Seeds an administrator role if it doesn't already exist
            if (!context.Roles.Any(r => r.Name == "Administrator"))
            {
                var store = new RoleStore<IdentityRole>(context);
                var manager = new RoleManager<IdentityRole>(store);
                var role = new IdentityRole { Name = "Administrator" };
                manager.Create(role);
            }
            //Seeds an administrator account. Obviously this is a poor idea for an actual application
            if (!context.Users.Any(u => u.UserName == "*****@*****.**"))
            {
                var store = new UserStore<ApplicationUser>(context);
                var manager = new UserManager<ApplicationUser>(store);
                var AdminUser = new ApplicationUser
                {
                    FirstName = "Admin",
                    LastName = "I. Strator",
                    UserName = "******",
                    Email = "*****@*****.**",
                };


                manager.Create(AdminUser, "P@ssword1");
                manager.AddToRole(AdminUser.Id, "Administrator");
            }

            var m1 = new Movie
            {
                ID = 1,
                Title = "Interstellar",
                ReleaseYear = 2014,
                Director = " Christopher Nolan",
                Genre = "Drama",
                Description = "Earth's future has been riddled by disasters, famines, and droughts. There is only one way to ensure mankind's survival: Interstellar travel. A newly discovered wormhole in the far reaches of our solar system allows a team of astronauts to go where no man has gone before, a planet that may have the right environment to sustain human life.",
                Price = 20,
                CoverArt = @"/Content/Images/Movies/Interstellar_Cover.jpg",
                PromoArt = @"/Content/Images/Movies/Interstellar_Promo.jpg",
                TrailerURL = @"2LqzF5WauAw"
            };

            var m2 = new Movie
            {
                ID = 2,
                Title = "The Notebook",
                ReleaseYear = 2004,
                Director = "Nick Cassavetes",
                Genre = "Romance",
                Description = "In a nursing home, resident Duke reads a romance story to an old woman who has senile dementia with memory loss. In the late 1930s, wealthy seventeen year-old Allie Hamilton is spending summer vacation in Seabrook. Local worker Noah Calhoun meets Allie at a carnival and they soon fall in love with each other. One day, Noah brings Allie to an ancient house that he dreams of buying and restoring and they attempt to make love but get interrupted by their friend. Allie's parents do not approve of their romance since Noah belongs to another social class, and they move to New York with her. Noah writes 365 letters (A Year) to Allie, but her mother Anne Hamilton does not deliver them to her daughter. Three years later, the United States joins the World War II and Noah and his best friend Fin enlist in the army, and Allie works as an army nurse. She meets injured soldier Lon Hammond in the hospital. After the war, they meet each other again going on dates and then, Lon, who is wealthy and ...",
                Price = 5,
                CoverArt = @"/Content/Images/Movies/notebook_cover.jpg",
                PromoArt = @"/Content/Images/Movies/notebook_promo.jpg",
                TrailerURL = @"yDJIcYE32NU"

            };

            var m3 = new Movie
            {
                ID = 3,
                Title = "Ice Age 3: Dawn of the Dinosaurs",
                ReleaseYear = 2009,
                Director = "Carlos Saldanha",
                Genre = "Comedy, Adventure",
                Description = "After the events of 'Ice Age: The Meltdown', life begins to change for Manny and his friends: Scrat is still on the hunt to hold onto his beloved acorn, while finding a possible romance in a female sabre-toothed squirrel named Scratte. Manny and Ellie, having since become an item, are expecting a baby, which leaves Manny anxious to ensure that everything is perfect for when his baby arrives. Diego is fed up with being treated like a house-cat and ponders the notion that he is becoming too laid-back. Sid begins to wish for a family of his own, and so steals some dinosaur eggs which leads to Sid ending up in a strange underground world where his herd must rescue him, while dodging dinosaurs and facing danger left and right, and meeting up with a one-eyed weasel known as Buck who hunts dinosaurs intently.",
                Price = 10,
                CoverArt = @"/Content/Images/Movies/iceage3_cover.jpg",
                PromoArt = @"/Content/Images/Movies/iceage3_promo.jpg",
                TrailerURL = @"Y_nSwh2WjAM"

            };
            var m4 = new Movie
            {
                ID = 4,
                Title = "Moana",
                ReleaseYear = 2016,
                Director = "Ron Clements",
                Genre = "Comedy, Adventure",
                Description = "Moana Waialiki is a sea voyaging enthusiast and the only daughter of a chief in a long line of navigators. When her island's fishermen can't catch any fish and the crops fail, she learns that the demigod Maui caused the blight by stealing the heart of the goddess, Te Fiti. The only way to heal the island is to persuade Maui to return Te Fiti's heart, so Moana sets off on an epic journey across the Pacific. The film is based on stories from Polynesian mythology.",
                Price = 26,
                CoverArt = @"/Content/Images/Movies/moana_cover.jpg",
                PromoArt = @"/Content/Images/Movies/moana_promo.jpg",
                TrailerURL = @"LKFuXETZUsI"

            };
            var m5 = new Movie
            {
                ID = 5,
                Title = "Jurassic World",
                ReleaseYear = 2015,
                Director = "Colin Trevorrow",
                Genre = "Action, Adventure, Sci-Fi",
                Description = "22 years after the original Jurassic Park failed, the new park (also known as Jurassic World) is open for business. After years of studying genetics the scientists on the park genetically engineer a new breed of dinosaur. When everything goes horribly wrong, will our heroes make it off the island?",
                Price = 24,
                CoverArt = @"/Content/Images/Movies/jurassic_world_cover.jpg",
                PromoArt = @"/Content/Images/Movies/jurassic_world_promo.jpg",
                TrailerURL = @"RFinNxS5KN4"
            };
            var m6 = new Movie
            {
                ID = 6,
                Title = "Peter Rabbit",
                ReleaseYear = 2018,
                Director = "Will Gluck",
                Genre = "Action, Adventure, Sci-Fi",
                Description = "Based on the books by Beatrix Potter: Peter Rabbit (James Corden;) his three sisters: Flopsy (Margot Robbie,) Mopsy (Elizabeth Debicki) and Cotton Tail (Daisy Ridley) and their cousin Benjamin (Colin Moody) enjoy their days harassing Mr McGregor in his vegetable garden. Until one day he dies and no one can stop them roaming across his house and lands for a full day or so. However, when one of Mr McGregor's relatives inherits the house and goes to check it out, he finds much more than he bargained for. What ensues, is a battle of wills between the new Mr McGregor and the rabbits. But when he starts to fall in love with Bea (Rose Byrne,) a real lover of all nature, his feelings towards them begin to change. But is it too late?",
                Price = 30,
                CoverArt = @"/Content/Images/Movies/peterrabbit_cover.jpg",
                PromoArt = @"/Content/Images/Movies/peterrabbit_promo.jpg",
                TrailerURL = @"7Pa_Weidt08"
            };
            var m7 = new Movie
            {
                ID = 7,
                Title = "The Greatest Showman",
                ReleaseYear = 2017,
                Director = "Michael Gracey",
                Genre = "Romance, Drama, Musical",
                Description = "Orphaned, penniless but ambitious and with a mind crammed with imagination and fresh ideas, the American Phineas Taylor Barnum will always be remembered as the man with the gift to effortlessly blur the line between reality and fiction. Thirsty for innovation and hungry for success, the son of a tailor will manage to open a wax museum but will soon shift focus to the unique and peculiar, introducing extraordinary, never-seen-before live acts on the circus stage. Some will call Barnum's wide collection of oddities, a freak show; however, when the obsessed showman gambles everything on the opera singer Jenny Lind to appeal to a high-brow audience, he will somehow lose sight of the most important aspect of his life: his family. Will Barnum risk it all to be accepted?",
                Price = 22,
                CoverArt = @"/Content/Images/Movies/TheGreatestShowman_cover.jpg",
                PromoArt = @"/Content/Images/Movies/TheGreatestShowman_promo.jpg",
                TrailerURL = @"AXCTMGYUg9A"
            };
            var m8 = new Movie
            {
                ID = 8,
                Title = "Tomb Raider",
                ReleaseYear = 2018,
                Director = "Roar Uthaug",
                Genre = "Action, Adventure, Drama",
                Description = "Lara Croft is the fiercely independent daughter of an eccentric adventurer who vanished when she was scarcely a teen. Now a young woman of 21 without any real focus or purpose, Lara navigates the chaotic streets of trendy East London as a bike courier, barely making the rent, and takes college courses, rarely making it to class. Determined to forge her own path, she refuses to take the reins of her father's global empire just as staunchly as she rejects the idea that he's truly gone.",
                Price = 30,
                CoverArt = @"/Content/Images/Movies/TombRaider2018_cover.jpg",
                PromoArt = @"/Content/Images/Movies/TombRaider2018_promo.jpg",
                TrailerURL = @"rOEHpkZCc1Y"
            };
            var m9 = new Movie
            {
                ID = 9,
                Title = "Game Night",
                ReleaseYear = 2018,
                Director = "John Francis Daley",
                Genre = "Comedy",
                Description = "Max and his wife, Annie, and their friends get together for 'Game Night' on a regular basis. His brother, Brooks, who's hosting the event this time, informs them that they're having a murder mystery party. Someone in the room will be kidnapped during the party. The other players must do everything they can to find him to win the grand prize. Brooks warns them that they won't know what is real or fake. When the door breaks open suddenly and Brooks is kidnapped, Max and the other players believe that it's merely the start of the mystery. What happens next proves that a real kidnapping can cause a lot of hilarious and even deadly confusion when everyone thinks it's just a game.",
                Price = 25,
                CoverArt = @"/Content/Images/Movies/gamenight_cover.jpg",
                PromoArt = @"/Content/Images/Movies/gamenight_promo.jpg",
                TrailerURL = @"qmxMAdV6s4U"
            };
            var m10 = new Movie
            {
                ID = 10,
                Title = "Ready Player One",
                ReleaseYear = 2018,
                Director = "Steven Spielberg",
                Genre = "Action, Adventure, Sci-Fi",
                Description = "In the year 2045, the real world is a harsh place. The only time Wade Watts (Tye Sheridan) truly feels alive is when he escapes to the OASIS, an immersive virtual universe where most of humanity spends their days. In the OASIS, you can go anywhere, do anything, be anyone-the only limits are your own imagination. The OASIS was created by the brilliant and eccentric James Halliday (Mark Rylance), who left his immense fortune and total control of the Oasis to the winner of a three-part contest he designed to find a worthy heir. When Wade conquers the first challenge of the reality-bending treasure hunt, he and his friends-aka the High Five-are hurled into a fantastical universe of discovery and danger to save the OASIS.",
                Price = 30,
                CoverArt = @"/Content/Images/Movies/readyplayerone_cover.jpg",
                PromoArt = @"/Content/Images/Movies/readyplayerone_promo.jpg",
                TrailerURL = @"cSp1dM2Vj48"
            };
            var m11 = new Movie
            {
                ID = 11,
                Title = "Show Dogs",
                ReleaseYear = 2018,
                Director = "Raja Gosnell",
                Genre = "Action, Adventure, Comedy",
                Description = "Max, a macho, solitary Rottweiler police dog is ordered to go undercover as a primped show dog in a prestigious Dog Show, along with his human partner, to avert a disaster from happening.",
                Price = 30,
                CoverArt = @"/Content/Images/Movies/showdogs_cover.jpg",
                PromoArt = @"/Content/Images/Movies/showdogs_promo.jpg",
                TrailerURL = @"eT9eWtb7C4c"
            };
            var m12 = new Movie
            {
                ID = 12,
                Title = "Beast",
                ReleaseYear = 2017,
                Director = "Michael Pearce",
                Genre = "Drama",
                Description = "A troubled woman living in an isolated community finds herself pulled between the control of her oppressive family and the allure of a secretive outsider suspected of a series of brutal murders.",
                Price = 28,
                CoverArt = @"/Content/Images/Movies/beast2017_cover.jpg",
                PromoArt = @"/Content/Images/Movies/beast2017_promo.jpg",
                TrailerURL = @"l6CWOjYSGH8"
            };
            var m13 = new Movie
            {
                ID = 13,
                Title = "Life of the Party",
                ReleaseYear = 2018,
                Director = "Ben Falcone",
                Genre = "Comedy",
                Description = "When her husband suddenly dumps her, longtime dedicated housewife Deanna turns regret into re-set by going back to college - landing in the same class and school as her daughter, who's not entirely sold on the idea. Plunging headlong into the campus experience, the increasingly outspoken Deanna -- now Dee Rock -- embraces freedom, fun, and frat boys on her own terms, finding her true self in a senior year no one ever expected.",
                Price = 30,
                CoverArt = @"/Content/Images/Movies/LifeOfTheParty_cover.jpg",
                PromoArt = @"/Content/Images/Movies/LifeOfTheParty_promo.jpg",
                TrailerURL = @"T1B1CxmAXLk"
            };
            var m14 = new Movie
            {
                ID = 14,
                Title = "Deadpool 2",
                ReleaseYear = 2018,
                Director = "David Leitch",
                Genre = "Action, Adventure, Comedy",
                Description = "After surviving a near fatal bovine attack, a disfigured cafeteria chef (Wade Wilson) struggles to fulfill his dream of becoming Mayberry's hottest bartender while also learning to cope with his lost sense of taste. Searching to regain his spice for life, as well as a flux capacitor, Wade must battle ninjas, the Yakuza, and a pack of sexually aggressive canines, as he journeys around the world to discover the importance of family, friendship, and flavor - finding a new taste for adventure and earning the coveted coffee mug title of World's Best Lover.",
                Price = 30,
                CoverArt = @"/Content/Images/Movies/Deadpool2_cover.jpg",
                PromoArt = @"/Content/Images/Movies/Deadpool2_promo.jpg",
                TrailerURL = @"D86RtevtfrA"
            };
            var m15 = new Movie
            {
                ID = 15,
                Title = "Book Club",
                ReleaseYear = 2018,
                Director = "Bill Holderman",
                Genre = "Comedy",
                Description = "Four older women spend their lives attending a book club where they bond over the typical suggested literature. One day, they end up reading Fifty Shades of Grey and are turned on by the content. Viewing it as a wake up call, they decide to expand their lives and chase pleasures that have eluded them.",
                Price = 30,
                CoverArt = @"/Content/Images/Movies/BookClub_cover.jpg",
                PromoArt = @"/Content/Images/Movies/BookClub_promo.jpg",
                TrailerURL = @"LDxgPIsv6sY"
            };
            var m16 = new Movie
            {
                ID = 16,
                Title = "Alice in Wonderland",
                ReleaseYear = 1999,
                Director = "Nick Welling",
                Genre = "Adventure, Comedy, Family",
                Description = "Alice follows a white rabbit down a rabbit-hole into a whimsical Wonderland, where she meets characters like the delightful Cheshire Cat, the clumsy White Knight, a rude caterpillar, and the hot-tempered Queen of Hearts and can grow ten feet tall or shrink to three inches. But will she ever be able to return home?",
                Price = 12,
                CoverArt = @"/Content/Images/Movies/Alice1999_cover.jpg",
                PromoArt = @"/Content/Images/Movies/Alice1999_promo.jpg",
                TrailerURL = @"LDxgPIsv6sY"
            };
            var m17 = new Movie
            {
                ID = 17,
                Title = "A Fistful of Dollars",
                ReleaseYear = 1964,
                Director = "Sergio Leone",
                Genre = "Western",
                Description = "An anonymous, but deadly man rides into a town torn by war between two factions, the Baxters and the Rojo's. Instead of fleeing or dying, as most other would do, the man schemes to play the two sides off each other, getting rich in the bargain.",
                Price = 5,
                CoverArt = @"/Content/Images/Movies/FistfulOfDollars_cover.jpg",
                PromoArt = @"/Content/Images/Movies/FistfulOfDollars_promo.jpg",
                TrailerURL = @"X2DtiE7VLw"
            };
            var m18 = new Movie
            {
                ID = 18,
                Title = "Casablanca",
                ReleaseYear = 1942,
                Director = "Michael Curtiz",
                Genre = "Drama, Romance",
                Description = "The story of Rick Blaine, a cynical world-weary ex-patriate who runs a nightclub in Casablanca, Morocco during the early stages of WWII. Despite the pressure he constantly receives from the local authorities, Rick's cafe has become a kind of haven for refugees seeking to obtain illicit letters that will help them escape to America. But when Ilsa, a former lover of Rick's, and her husband, show up to his cafe one day, Rick faces a tough challenge which will bring up unforeseen complications, heartbreak and ultimately an excruciating decision to make ",
                Price = 6,
                CoverArt = @"/Content/Images/Movies/casablanca_cover.jpg",
                PromoArt = @"/Content/Images/Movies/casablanca_cover.jpg",
                TrailerURL = @"BkL9l7qovsE"
            };
            var m19 = new Movie
            {
                ID = 19,
                Title = "Titanic",
                ReleaseYear = 1997,
                Director = "James Cameron",
                Genre = "Drama, Romance",
                Description = "84 years later, a 100 year-old woman named Rose DeWitt Bukater tells the story to her granddaughter Lizzy Calvert, Brock Lovett, Lewis Bodine, Bobby Buell and Anatoly Mikailavich on the Keldysh about her life set in April 10th 1912, on a ship called Titanic when young Rose boards the departing ship with the upper-class passengers and her mother, Ruth DeWitt Bukater, and her fianc�E Caledon Hockley. Meanwhile, a drifter and artist named Jack Dawson and his best friend Fabrizio De Rossi win third-class tickets to the ship in a game. And she explains the whole story from departure until the death of Titanic on its first and last voyage April 15th, 1912 at 2:20 in the morning.",
                Price = 8,
                CoverArt = @"/Content/Images/Movies/Titanic_Cover.jpg",
                PromoArt = @"/Content/Images/Movies/Titanic_Promo.jpg",
                TrailerURL = @"2e-eXJ6HgkQ"
            };
            var m20 = new Movie
            {
                ID = 20,
                Title = "The Dark Knight",
                ReleaseYear = 2008,
                Director = "Christopher Nolan",
                Genre = "Action, Crime, Drama",
                Description = "Set within a year after the events of Batman Begins, Batman, Lieutenant James Gordon, and new district attorney Harvey Dent successfully begin to round up the criminals that plague Gotham City until a mysterious and sadistic criminal mastermind known only as the Joker appears in Gotham, creating a new wave of chaos. Batman's struggle against the Joker becomes deeply personal, forcing him to 'confront everything he believes' and improve his technology to stop him.",
                Price = 12,
                CoverArt = @"/Content/Images/Movies/DarkKnight_Cover.jpg",
                PromoArt = @"/Content/Images/Movies/DarkKnight_Promo.jpg",
                TrailerURL = @"EXeTwQWrcwY"
            };
            var m21 = new Movie
            {
                ID = 21,
                Title = "Lord of the Rings: The Fellowship of the Ring",
                ReleaseYear = 2001,
                Director = "Peter Jackson",
                Genre = "Adventure, Drama, Fantasy",
                Description = "The Lord of the Rings: The Fellowship of the Ring is the first movie in Peter Jackson's epic fantasy trilogy. An ancient Ring thought lost for centuries has been found, and through a strange twist in fate has been given to a small Hobbit named Frodo. When Gandalf discovers the Ring is in fact the One Ring of the Dark Lord Sauron, Frodo must make an epic quest in order to destroy it!",
                Price = 8,
                CoverArt = @"/Content/Images/Movies/LotR1_Cover.jpg",
                PromoArt = @"/Content/Images/Movies/LotR1_Promo.jpg",
                TrailerURL = @"V75dMMIW2B4"
            };
            var m22 = new Movie
            {
                ID = 22,
                Title = "Gladiator",
                ReleaseYear = 2000,
                Director = "Ridley Scott",
                Genre = "Action, Adventure, Drama",
                Description = "Maximus is a powerful Roman general, loved by the people and the aging Emperor, Marcus Aurelius. Before his death, the Emperor chooses Maximus to be his heir over his own son, Commodus, and a power struggle leaves Maximus and his family condemned to death. The powerful general is unable to save his family, and his loss of will allows him to get captured and put into the Gladiator games until he dies. The only desire that fuels him now is the chance to rise to the top so that he will be able to look into the eyes of the man who will feel his revenge.",
                Price = 8,
                CoverArt = @"/Content/Images/Movies/Gladiator_Cover.jpg",
                PromoArt = @"/Content/Images/Movies/Gladiator_Promo.jpg",
                TrailerURL = @"VB5aBE6e00U"
            };
            var m23 = new Movie
            {
                ID = 23,
                Title = "Inglorious Basterds",
                ReleaseYear = 2009,
                Director = "Quentin Tarantino",
                Genre = "Adventure, Drama, War",
                Description = "In German-occupied France, young Jewish refugee Shosanna Dreyfus witnesses the slaughter of her family by Colonel Hans Landa. Narrowly escaping with her life, she plots her revenge several years later when German war hero Fredrick Zoller takes a rapid interest in her and arranges an illustrious movie premiere at the theater she now runs. With the promise of every major Nazi officer in attendance, the event catches the attention of the 'Basterds', a group of Jewish-American guerrilla soldiers led by the ruthless Lt. Aldo Raine. As the relentless executioners advance and the conspiring young girl's plans are set in motion, their paths will cross for a fateful evening that will shake the very annals of history.",
                Price = 8,
                CoverArt = @"/Content/Images/Movies/Basterds_Cover.jpg",
                PromoArt = @"/Content/Images/Movies/Basterds_Promo.jpg",
                TrailerURL = @"6AtLlVNsuAc"
            };
            var m24 = new Movie
            {
                ID = 24,
                Title = "I Am Legend",
                ReleaseYear = 2007,
                Director = "Francis Lawrence",
                Genre = "Drama, Horror, Sci-Fi",
                Description = "Robert Neville is a scientist who was unable to stop the spread of the terrible virus that was incurable and man-made. Immune, Neville is now the last human survivor in what is left of New York City and perhaps the world. For three years, Neville has faithfully sent out daily radio messages, desperate to find any other survivors who might be out there. But he is not alone. Mutant victims of the plague -- The Infected -- lurk in the shadows... watching Neville's every move... waiting for him to make a fatal mistake.",
                Price = 10,
                CoverArt = @"/Content/Images/Movies/IAmLegend_Cover.jpg",
                PromoArt = @"/Content/Images/Movies/IAmLegend_Cover.jpg",
                TrailerURL = @"dtKMEAXyPkg"
            };
            context.Movies.AddOrUpdate(m => m.ID, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15, m16, m17, m18, m19, m20, m21, m22, m23, m24);


            //Seeds users/customers to the database
            if (!context.Users.Any(u => u.UserName == "*****@*****.**"))
            {
                var store = new UserStore<ApplicationUser>(context);
                var manager = new UserManager<ApplicationUser>(store);
                var C1 = new ApplicationUser
                {
                    FirstName = "Hannah",
                    LastName = "Handlebars",
                    BillingAddress = "23 Floof Rd.",
                    BillingZip = "64477",
                    BillingCity = "Fluffington",
                    PhoneNumber = "0722267435",
                    UserName = "******",
                    Email = "*****@*****.**",
                };
                var C2 = new ApplicationUser
                {
                    FirstName = "Ronald",
                    LastName = "Racuous",
                    BillingAddress = "23 Floof Rd.",
                    BillingZip = "64477",
                    BillingCity = "Fluffington",
                    Email = "*****@*****.**",
                    PhoneNumber = "0762458731",
                    UserName = "******"
                };
                var C3 = new ApplicationUser
                {
                    FirstName = "Pia",
                    LastName = "Pajama",
                    BillingAddress = "18 Bunnyhop Ln.",
                    BillingZip = "64458",
                    BillingCity = "Fluffington",
                    Email = "*****@*****.**",
                    UserName = "******",
                    PhoneNumber = "0708742354"
                };
                var C4 = new ApplicationUser
                {
                    FirstName = "Marjory",
                    LastName = "Delaqua",
                    BillingAddress = "14 Grenth Plaza.",
                    BillingZip = "66645",
                    BillingCity = "Divinity's Reach",
                    Email = "*****@*****.**",
                    UserName = "******",
                    PhoneNumber = "0757896521"
                };
                var C5 = new ApplicationUser
                {
                    FirstName = "Kasmeer",
                    LastName = "Meade",
                    BillingAddress = "14 Grenth Plaza.",
                    BillingZip = "66645",
                    BillingCity = "Divinity's Reach",
                    Email = "*****@*****.**",
                    UserName = "******",
                    PhoneNumber = "0748942482"
                };
                var C6 = new ApplicationUser
                {
                    FirstName = "Frederique",
                    LastName = "Gaston",
                    BillingAddress = "2 Barley Ave.",
                    BillingZip = "87954",
                    BillingCity = "Thompton",
                    Email = "*****@*****.**",
                    UserName = "******",
                    PhoneNumber = "0724821212"
                };
                var C7 = new ApplicationUser
                {
                    FirstName = "Eoghan",
                    LastName = "McGrath",
                    BillingAddress = "1 Spice Plaza Apts.",
                    BillingZip = "78545",
                    BillingCity = "Verilla",
                    Email = "*****@*****.**",
                    UserName = "******",
                    PhoneNumber = "0765484852"
                };


                manager.Create(C1, "P@ssword1");
                manager.Create(C2, "P@ssword1");
                manager.Create(C3, "P@ssword1");
                manager.Create(C4, "P@ssword1");
                manager.Create(C5, "P@ssword1");
                manager.Create(C6, "P@ssword1");
                manager.Create(C7, "P@ssword1");
            }
            //Seeds reviews for Interstellar
            var rev1 = new Review
            {
                ID = 1,
                UserID = context.Users.SingleOrDefault(u => u.Email == "*****@*****.**").Id,
                MovieID = 1,
                Rating = 5,
                Comment = "This movie is totally awesome. It completely changed my life. Spoiler warning: when the thing happened I was just so thrilled! It's so cool to see Actors performance in this role. Director did the director stuff really well too. I can't wait for a sequel!"
            };
            var rev2 = new Review
            {
                ID = 2,
                UserID = context.Users.SingleOrDefault(u => u.Email == "*****@*****.**").Id,
                MovieID = 6,
                Rating = 1,
                Comment = "Meh... The shiny stuff wasn't as shiny as I would've hoped, and the lines were dumb. I particularly hated it when the actor went all 'Hurr durr I'm the protagonist I can do things!' That's just lazy writing."
            };
            var rev3 = new Review
            {
                ID = 3,
                UserID = context.Users.SingleOrDefault(u => u.Email == "*****@*****.**").Id,
                MovieID = 12,
                Rating = 3,
                Comment = "It's a movie. It is an OK movie. I liked it."
            };
            var rev4 = new Review
            {
                ID = 4,
                UserID = context.Users.SingleOrDefault(u => u.Email == "*****@*****.**").Id,
                MovieID = 2,
                Rating = 5,
                Comment = "Oh my goose, I absolutely LOVE this movie! I've seen it so many times that my disc is all worn out. Jory is getting kind of tired of it, but I can just keep watching it over, and over again! I ordered an extra copy for the commander!"
            };
            var rev5 = new Review
            {
                ID = 5,
                UserID = context.Users.SingleOrDefault(u => u.Email == "*****@*****.**").Id,
                MovieID = 2,
                Rating = 4,
                Comment = "I really enjoy this movie. Kas is under the impression that I'm not too fond of it, but the acting is superb and the story is fantastic."
            };
            context.Reviews.AddOrUpdate(r => r.ID, rev1, rev2, rev3, rev4, rev5);

            //Seeds orders
            var order1 = new Order
            {
                ID = 1,
                UserID = context.Users.SingleOrDefault(u => u.Email == "*****@*****.**").Id,
                OrderDate = DateTime.Now
            };
            var order2 = new Order
            {
                ID = 2,
                UserID = context.Users.SingleOrDefault(u => u.Email == "*****@*****.**").Id,
                OrderDate = DateTime.Now
            };
            context.Orders.AddOrUpdate(or => or.ID, order1, order2);
            //Seeds rows for the orders
            var or1r1 = new OrderRow
            {
                ID = 1,
                MovieID = 6,
                OrderID = 1,
                Price = m6.Price,
                Quantity = 1
            };
            var or1r2 = new OrderRow
            {
                ID = 2,
                MovieID = 3,
                OrderID = 1,
                Price = m3.Price,
                Quantity = 1
            };
            var or2r1 = new OrderRow
            {
                ID = 3,
                MovieID = 2,
                OrderID = 2,
                Price = m2.Price,
                Quantity = 2
            };
            var or2r2 = new OrderRow
            {
                ID = 4,
                MovieID = 4,
                OrderID = 2,
                Price = m4.Price,
                Quantity = 1
            };
            context.OrderRows.AddOrUpdate(row => row.ID, or1r1, or1r2, or2r1, or2r2);


        }
コード例 #44
0
        public async Task CreateMovieCollectionToMovieRelationship(MovieCollection movieCollection, Movie movie)
        {
            var relation = Relation.Instanciate(MovieCollection.ENTITY_CATEGORY_ID, movieCollection.GetId(),
                                                Movie.ENTITY_CATEGORY_ID, movie.GetId(), Relation.RELATION_STATUS_ACTIVE_ID, DateTime.Now);

            await Save(relation);
        }
コード例 #45
0
ファイル: Repository.cs プロジェクト: Haahr2111/MbmStore
        static repository()
        {
            //objects
            //Music
            var Beatles = new MusicCD("Beatles", "Abbey Road", 125, 26 - 9 - 1969, "/Images/abbey.jfif");

            Beatles.AddTracks(new Track("Come together", "John Lennon", new TimeSpan(0, 7, 30)));
            Beatles.AddTracks(new Track("Something", "John Lennon", new TimeSpan(0, 5, 34)));
            Beatles.AddTracks(new Track("Maxwell's Silver Hammer", "Paul Mccartney", new TimeSpan(0, 5, 34)));
            Beatles.AddTracks(new Track("Oh! Darling", "", new TimeSpan(0, 3, 20)));
            Beatles.AddTracks(new Track("Octopus's Darling", "John Lennon", new TimeSpan(0, 2, 10)));

            var Veto = new MusicCD("VETO", "There's a Beat in All Machines", 190, 27 - 2 - 2006, "/Images/veto.jfif");

            Veto.AddTracks(new Track("Can you see anything", "Troels Abrahamsen", new TimeSpan(0, 3, 42)));
            Veto.AddTracks(new Track("We are not friends", "Troels Abrahamsen", new TimeSpan(0, 4, 12)));
            Veto.AddTracks(new Track("You Are a Knife", "VETO", new TimeSpan(0, 3, 32)));

            //books
            Book b1 = new Book("Stanley Kubrick", "The Shining", 150, 28 - 1 - 1977, "/Images/shining.jfif");
            Book b2 = new Book("Gud", "Biblen", 250, 0 - 0 - 0, "/Images/bible.jfif");

            //Movies
            // create a new Movie object with instance name jungleBook
            var jungle = new Movie("Jungle Book", 160.50m, "/Images/junglebook.jpg", "Jon Favreau");

            // assign a ViewBag property to the new Movie object


            // create a new Movie object with instance name jungleBook
            var gladiator = new Movie("Gladiator", 160.50m, "/Images/gladiator.jpg", "Ridley Scott");

            var forrestgump = new Movie("Forrest Gump", 160.50m, "/Images/forrest-gump.jpg", "Rasmus Haahr");

            // assign a ViewBag property to the new Movie object

            Products.Add(Beatles);
            Products.Add(Veto);
            Products.Add(b1);
            Products.Add(b2);
            Products.Add(jungle);
            Products.Add(gladiator);
            Products.Add(forrestgump);

            //custumers
            var Custumer1 = new Custumer("Søren", "N", "Helvedes Kerne 666", "6666", "Hell");


            var Custumer2 = new Custumer("Jesus", "Christ", "Heaven road 888", "420", "Sky");

            var Custumer3 = new Custumer("Leif", "Dahlgaard", "Ingen fast Adresse", "0000", "Frederiks");

            //Orderitems
            var Order1 = new OrderItem(jungle, 2);
            var Order2 = new OrderItem(Veto, 1);
            var Order3 = new OrderItem(gladiator, 3);
            var Order4 = new OrderItem(Beatles, 2);

            //Invoices

            var I1 = new Invoice(1, DateTime.Now, Custumer1);

            I1.AddOrderItems(Order1);
            I1.AddOrderItems(Order2);
            var I2 = new Invoice(2, DateTime.Now, Custumer2);

            I2.AddOrderItems(Order3);
            I2.AddOrderItems(Order4);

            Invoices.Add(I1);
            Invoices.Add(I2);
        }
コード例 #46
0
 public void Save(Movie entity)
 {
     MovieRepository.Save(entity);
 }
コード例 #47
0
        static void Main(string[] args)
        {
            Movie        movie1    = new Movie("Scary Movie", Genre.Comedy, 4, 2.5);
            Movie        movie2    = new Movie("American Pie", Genre.Comedy, 4, 2.5);
            Movie        movie3    = new Movie("Saw", Genre.Horror, 4, 2.5);
            Movie        movie4    = new Movie("The Shining", Genre.Horror, 4, 2.5);
            Movie        movie5    = new Movie("Rambo", Genre.Action, 4, 2.5);
            Movie        movie6    = new Movie("The Terminator", Genre.Action, 4, 2.5);
            Movie        movie7    = new Movie("Forrest Gump", Genre.Drama, 4, 2.5);
            Movie        movie8    = new Movie("12 Angru Men", Genre.Drama, 4, 2.5);
            Movie        movie9    = new Movie("Passengers", Genre.SciFi, 4, 2.5);
            Movie        movie10   = new Movie("Interstellar", Genre.SciFi, 4, 2.5);
            List <Movie> MovieSet1 = new List <Movie>()
            {
                movie1, movie2, movie3, movie4, movie5, movie6, movie7, movie8, movie9, movie10
            };
            Movie        movie11   = new Movie("Airplane", Genre.Comedy, 4, 2.5);
            Movie        movie12   = new Movie("Johnny English", Genre.Comedy, 4, 2.5);
            Movie        movie13   = new Movie("The Ring", Genre.Horror, 4, 2.5);
            Movie        movie14   = new Movie("Sinister", Genre.Horror, 4, 2.5);
            Movie        movie15   = new Movie("RoboCop", Genre.Action, 4, 2.5);
            Movie        movie16   = new Movie("Judge Dredd", Genre.Action, 4, 2.5);
            Movie        movie17   = new Movie("The Social Network", Genre.Drama, 4, 2.5);
            Movie        movie18   = new Movie("The Shawshank Redemption", Genre.Drama, 4, 2.5);
            Movie        movie19   = new Movie("Inception", Genre.SciFi, 4, 2.5);
            Movie        movie20   = new Movie("Avatar", Genre.SciFi, 4, 2.5);
            List <Movie> MovieSet2 = new List <Movie>()
            {
                movie11, movie12, movie13, movie14, movie15, movie16, movie17, movie18, movie19, movie20
            };


            Cinema cinema1 = new Cinema("Cineplex");

            cinema1.Halls = new List <int>()
            {
                1, 2, 3, 4
            };
            cinema1.ListOfMovies = MovieSet1;
            Cinema cinema2 = new Cinema("Milenium");

            cinema2.Halls = new List <int>()
            {
                1, 2
            };
            cinema2.ListOfMovies = MovieSet2;


            Console.WriteLine("Choose a Cinema: 1) Cineplex 2)Milenium");

            Cinema temp = new Cinema();

            try
            {
                int number1 = int.Parse(Console.ReadLine());
                if ((number1 > 0) && (number1 < 3))
                {
                    switch (number1)
                    {
                    case 1:
                        temp = cinema1;
                        Console.WriteLine($"you selected {temp.Name}");
                        break;

                    case 2:
                        temp = cinema2;
                        Console.WriteLine($"you selected {temp.Name}");
                        break;
                    }
                }
                else
                {
                    throw new Exception("wrong input");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            Console.WriteLine("Choose to see: 1) All Movies 2)By genre");
            try
            {
                int number2 = int.Parse(Console.ReadLine());
                if ((number2 > 0) && (number2 < 3))
                {
                    switch (number2)
                    {
                    case 1:
                        foreach (var movie in temp.ListOfMovies)
                        {
                            Console.WriteLine(movie.Title);
                        }
                        Console.WriteLine("------------------------------");
                        Console.WriteLine("Write the title of the movie you want to watch:");
                        string film = Console.ReadLine();
                        temp.ListOfMovies = temp.ListOfMovies.Where(x => x.Title.ToLower() == film.ToLower()).ToList();

                        foreach (var movie in temp.ListOfMovies)
                        {
                            temp.WatchMovie(movie);
                        }

                        break;

                    case 2:
                        Console.WriteLine("------------------");
                        Console.WriteLine("Comedy,Horror,Action,Drama,SciFi");
                        Console.WriteLine("write your genre bellow");
                        string genre1 = Console.ReadLine();
                        temp.ListOfMovies = temp.ListOfMovies.Where(x => x.Genre.ToString().ToLower() == genre1.ToLower()).ToList();
                        foreach (var movie in temp.ListOfMovies)
                        {
                            Console.WriteLine(movie.Title);
                        }
                        Console.WriteLine("-------------------");
                        Console.WriteLine("Write the movie you want to watch");
                        string watchMovie = Console.ReadLine();
                        temp.ListOfMovies = temp.ListOfMovies.Where(x => x.Title.ToLower() == watchMovie.ToLower()).ToList();
                        foreach (var movie in temp.ListOfMovies)
                        {
                            temp.WatchMovie(movie);
                        }

                        break;
                    }
                }
                else
                {
                    throw new Exception("wrong input");
                }
            }catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.ReadLine();
        }
コード例 #48
0
 public IActionResult Post([FromBody] Movie value)
 {
     _context.Add(value);
     _context.SaveChanges();
     return(Ok());
 }
コード例 #49
0
        public async Task Update(Movie movie)
        {
            await _unitOfWork.Movie.UpdateAsync(movie);

            await _unitOfWork.CommitAsync();
        }
コード例 #50
0
 public void UpdateMovie(Movie movie)
 {
     movies.Update(movie);
 }
コード例 #51
0
        public static bool CheckFavorite(Movie movie)
        {
            List <Movie> favorites = GetFavorites();

            return(favorites.Find(m => m.Title == movie.Title) != null);
        }
コード例 #52
0
 public ActionResult Create(Movie movie)
 {
     _context.Movies.Add(movie);
     _context.SaveChanges();
     return(RedirectToAction("ListaMovies", "Movies"));
 }
コード例 #53
0
 public void AddMovie(Movie movie)
 {
     _movies.Add(movie);
 }
コード例 #54
0
ファイル: Extensions.cs プロジェクト: ratspiket/Emby.Plugins
        public static bool MetadataIsDifferent(this TraktMovieCollected collectedMovie, Movie movie)
        {
            var audioStream = movie.GetMediaStreams().FirstOrDefault(x => x.Type == MediaStreamType.Audio);

            var resolution = movie.GetDefaultVideoStream().GetResolution();
            var audio = GetCodecRepresetation(audioStream);
            var audioChannels = audioStream.GetAudioChannels();

            if (collectedMovie.Metadata == null || collectedMovie.Metadata.IsEmpty())
            {
                return !string.IsNullOrEmpty(resolution) || !string.IsNullOrEmpty(audio) || !string.IsNullOrEmpty(audioChannels);
            }
            return collectedMovie.Metadata.Audio != audio ||
                   collectedMovie.Metadata.AudioChannels != audioChannels ||
                   collectedMovie.Metadata.Resolution != resolution;
        }
コード例 #55
0
        public void UpdateMovie(Movie movie)
        {
            Movie modified = _movies.FirstOrDefault(x => x.Id == movie.Id);

            modified = movie;
        }
コード例 #56
0
 public Movie Add(Movie movie)
 {
     movie.MovieId = _moviesList.Max(e => e.MovieId) + 1;
     _moviesList.Add(movie);
     return(movie);
 }
コード例 #57
0
 public MovieDetailsPage(Movie movie, IMovieApi api)
 {
     this._viewModel     = new MovieDetailsViewModel(this.Navigation, movie, api);
     this.BindingContext = this._viewModel;
     InitializeComponent();
 }
コード例 #58
0
        // GET: Movie/Delete/5
        public ActionResult Delete(int id)
        {
            Movie m = ms.GetMovieById(id);

            return(View());
        }
コード例 #59
0
        /// <summary>
        /// Retrieves a movie by it's imdb Id
        /// </summary>
        /// <param name="imdbId">The Imdb id of the movie OR the TMDb id as string</param>
        /// <param name="language">Language to localize the results in.</param>
        /// <param name="extraMethods">A list of additional methods to execute for this req as enum flags</param>
        /// <param name="cancellationToken">A cancellation token</param>
        /// <returns>The reqed movie or null if it could not be found</returns>
        /// <remarks>Requires a valid user session when specifying the extra method 'AccountStates' flag</remarks>
        /// <exception cref="UserSessionRequiredException">Thrown when the current client object doens't have a user session assigned, see remarks.</exception>
        public async Task <Movie> GetMovieAsync(string imdbId, string language, MovieMethods extraMethods = MovieMethods.Undefined, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (extraMethods.HasFlag(MovieMethods.AccountStates))
            {
                RequireSessionId(SessionType.UserSession);
            }

            RestRequest req = _client.Create("movie/{movieId}");

            req.AddUrlSegment("movieId", imdbId);
            if (extraMethods.HasFlag(MovieMethods.AccountStates))
            {
                AddSessionId(req, SessionType.UserSession);
            }

            if (language != null)
            {
                req.AddParameter("language", language);
            }

            string appends = string.Join(",",
                                         Enum.GetValues(typeof(MovieMethods))
                                         .OfType <MovieMethods>()
                                         .Except(new[] { MovieMethods.Undefined })
                                         .Where(s => extraMethods.HasFlag(s))
                                         .Select(s => s.GetDescription()));

            if (appends != string.Empty)
            {
                req.AddParameter("append_to_response", appends);
            }

            RestResponse <Movie> response = await req.ExecuteGet <Movie>(cancellationToken).ConfigureAwait(false);

            if (!response.IsValid)
            {
                return(null);
            }

            Movie item = await response.GetDataObject().ConfigureAwait(false);

            // Patch up data, so that the end user won't notice that we share objects between req-types.
            if (item.Videos != null)
            {
                item.Videos.Id = item.Id;
            }

            if (item.AlternativeTitles != null)
            {
                item.AlternativeTitles.Id = item.Id;
            }

            if (item.Credits != null)
            {
                item.Credits.Id = item.Id;
            }

            if (item.Releases != null)
            {
                item.Releases.Id = item.Id;
            }

            if (item.Keywords != null)
            {
                item.Keywords.Id = item.Id;
            }

            if (item.Translations != null)
            {
                item.Translations.Id = item.Id;
            }

            if (item.AccountStates != null)
            {
                item.AccountStates.Id = item.Id;
            }

            if (item.ExternalIds != null)
            {
                item.ExternalIds.Id = item.Id;
            }

            // Overview is the only field that is HTML encoded from the source.
            item.Overview = WebUtility.HtmlDecode(item.Overview);

            return(item);
        }
コード例 #60
0
 public Task <ItemUpdateType> FetchAsync(Movie item, MetadataRefreshOptions options, CancellationToken cancellationToken)
 {
     return(FetchVideoInfo(item, options, cancellationToken));
 }