Beispiel #1
0
        public static Core.Movies.Movie ToModel(this MovieResource resource, Core.Movies.Movie movie)
        {
            var updatedmovie = resource.ToModel();

            movie.ApplyChanges(updatedmovie);

            return(movie);
        }
Beispiel #2
0
        public static Core.Movies.Movie ToModel(this MovieResource resource)
        {
            if (resource == null)
            {
                return(null);
            }

            return(new Core.Movies.Movie
            {
                Id = resource.Id,
                TmdbId = resource.TmdbId,

                Title = resource.Title,

                //AlternateTitles
                SortTitle = resource.SortTitle,
                InCinemas = resource.InCinemas,
                PhysicalRelease = resource.PhysicalRelease,

                //TotalEpisodeCount
                //EpisodeCount
                //EpisodeFileCount
                //SizeOnDisk
                Overview = resource.Overview,

                //NextAiring
                //PreviousAiring
                Images = resource.Images,

                Year = resource.Year,
                SecondaryYear = resource.SecondaryYear,

                Path = resource.Path,
                ProfileId = resource.ProfileId,

                Monitored = resource.Monitored,
                MinimumAvailability = resource.MinimumAvailability,

                Runtime = resource.Runtime,
                LastInfoSync = resource.LastInfoSync,
                CleanTitle = resource.CleanTitle,
                ImdbId = resource.ImdbId,
                TitleSlug = resource.TitleSlug,
                RootFolderPath = resource.RootFolderPath,
                Certification = resource.Certification,
                Website = resource.Website,
                Genres = resource.Genres,
                Tags = resource.Tags,
                Added = resource.Added,
                AddOptions = resource.AddOptions,

                //AlternativeTitles = resource.AlternativeTitles,
                Ratings = resource.Ratings,
                YouTubeTrailerId = resource.YouTubeTrailerId,
                Studio = resource.Studio
            });
        }
Beispiel #3
0
        private Response SaveAll()
        {
            var resources = Request.Body.FromJson <List <MovieResource> >();

            var Movie = resources.Select(MovieResource => MovieResource.ToModel(_movieService.GetMovie(MovieResource.Id))).ToList();

            return(_movieService.UpdateMovie(Movie)
                   .ToResource()
                   .AsResponse(HttpStatusCode.Accepted));
        }
Beispiel #4
0
        public static Core.Movies.Movie ToModel(this MovieResource resource, Core.Movies.Movie movie)
        {
            movie.ImdbId = resource.ImdbId;
            movie.TmdbId = resource.TmdbId;

            movie.Path      = resource.Path;
            movie.ProfileId = resource.ProfileId;
            movie.PathState = resource.PathState;

            movie.Monitored           = resource.Monitored;
            movie.MinimumAvailability = resource.MinimumAvailability;

            movie.RootFolderPath = resource.RootFolderPath;
            movie.Tags           = resource.Tags;
            movie.AddOptions     = resource.AddOptions;

            return(movie);
        }