public ProviderViewModel(IMovieProvider movieProvider)
        {
            _movieProvider = movieProvider;

            Name = _movieProvider.Name;
            Description = _movieProvider.Description;
        }
示例#2
0
 public MovieModelBuilder(
     IMovieRequestBuilder movieRequestBuilder,
     IMovieProvider searchProvider)
 {
     _movieRequestBuilder = movieRequestBuilder ?? throw new ArgumentNullException(nameof(movieRequestBuilder));
     _searchProvider      = searchProvider ?? throw new ArgumentNullException(nameof(searchProvider));
 }
示例#3
0
        public async Task <IActionResult> OnGetMovieSelection(string id, string providerMovieId)
        {
            // Bereits bekannten Film laden
            Movie = await MovieService.GetWithGenresAndSourcesAsync(id);

            // Falls nicht bekannt, neuen Film anlegen
            if (Movie == null)
            {
                Movie = MovieService.CreateMovie();
            }

            // Übernahme der Daten aus MovieDb
            IMovieProvider movieProvider = MovieProviderFactory.CreateMovieProvider(MovieProviders.MovieDb);
            var            movieDto      = await movieProvider.GetMovieAsync(providerMovieId);

            Movie = await MovieService.ApplyDtoData(Movie, movieDto);

            await Init();

            // Speichern des Films nach der Auswahl: Eigentlich nicht nötig, aber wegen des "falschen" Cover-Handlings notwendig,
            // damit das ausgewählte Cover nicht verloren geht (es ist nicht gebunden, da byte-Array)
            // Siehe auch Kommentar bei SetCover
            await SaveChanesAsync();

            return(Page());
        }
示例#4
0
        public ProviderViewModel(IMovieProvider movieProvider)
        {
            _movieProvider = movieProvider;

            Name        = _movieProvider.Name;
            Description = _movieProvider.Description;
        }
        public async Task <IActionResult> OnGetAsync(string id, string title, MovieProviders provider)
        {
            MovieId = id;

            IMovieProvider movieProvider = MovieProviderFactory.CreateMovieProvider(provider);

            try
            {
                var movies = await movieProvider.SearchMovieAsync(title);

                Movies = new List <MovieDbMovie>();

                await Task.Run(() =>
                {
                    foreach (MovieDbMovie movieDto in movies)
                    {
                        movieDto.Cover = movieProvider.GetMovieCover(movieDto);
                        Movies.Add(movieDto);
                    }
                });
            }
            catch (Exception ex)
            {
                //TODO: Logging im WebProject
                //LogManager.GetCurrentClassLogger().Error(ex);
            }

            return(Page());
        }
示例#6
0
 public MovieModule(IMovieProvider provider)
 {
     Get("/movies/{id}", args =>
     {
         int id = int.Parse(args.id);
         return(Response.AsJson(provider.GetById((id))));
     });
 }
示例#7
0
        private async Task OpenSelectionPage(IMovieProvider movieProvider)
        {
            var selectionView = Resolver.Resolve <MovieSelectionPage>();
            var viewModel     = selectionView.BindingContext as MovieSelectionViewModel;

            viewModel.Title = "Filmauswahl";
            viewModel.Movie = Movie;
            viewModel.LoadCommand.Execute(movieProvider);
            viewModel.OnMovieSelectionChanged += async(movie) => await ApplyMovieSelection(movie);

            await Navigation.PushAsync(selectionView);
        }
示例#8
0
        public Movie[] GetMoviesDirectedBy(string director)
        {
            IMovieProvider movieProvider = serviceLocator.GetInstance <IMovieProvider>();

            IEnumerable <Movie> allMovies  = movieProvider.GetAll();
            List <Movie>        resultList = new List <Movie>();

            foreach (var movie in allMovies)
            {
                if (IsDirectedBy(movie, director))
                {
                    resultList.Add(movie);
                }
            }

            return(resultList.ToArray());
        }
示例#9
0
        public static DBSourceInfo GetFromProviderObject(IMovieProvider provider)
        {
            foreach (DBSourceInfo currSource in GetAll())
            {
                if (currSource.providerType == provider.GetType())
                {
                    if (currSource.IsScriptable())
                    {
                        return(GetFromScriptID(((IScriptableMovieProvider)provider).ScriptID));
                    }
                    else
                    {
                        return(currSource);
                    }
                }
            }

            return(null);
        }
 public MovieService(ILogger <MovieService> logger, IMovieRepository repository, IMapper mapper, IMovieProvider movieProvider) : base(logger, repository, mapper)
 {
     _movieProvider = movieProvider;
 }
示例#11
0
 public HomeController(IConfiguration configuration, IMovieProvider movieProvider)
 {
     ApplicationSettings.WebApiUrl = configuration.GetValue <string>("MySettings:WebApiBaseUrl");
     _apikey        = configuration.GetValue <string>("MySettings:ApiKey");
     _movieProvider = movieProvider;
 }
示例#12
0
 //     private MovieProvider _movieProvider = new MovieProvider();
 public MovieController(IMovieProvider movieProvider)
 {
     _movieProvider = movieProvider;
 }
示例#13
0
 public void Enqueue(IMovieProvider sender, Uri uri)
 {
     Enqueue(uri);
     EnqueueCompleted();
 }
示例#14
0
 public void InjectMovieProvider(IMovieProvider provider)
 {
     movieProvider = provider;
 }
示例#15
0
 public MovieDetail(Movie m, IMovieProvider provider, ManualResetEvent e)
 {
     m_pProvider = provider;
     m_pMovie    = m;
     m_pEvent    = e;
 }
 public ConvertedMovieProvider(IMovieProvider decorated, IMovieConverter converter, DirectoryInfo targetDirectory)
 {
     this.decorated       = decorated;
     this.converter       = converter;
     this.targetDirectory = targetDirectory;
 }
 public MovieLister(IMovieProvider movieProvider)
     : this(movieProvider, new EmptyFilter())
 {
     this.MovieProvider = movieProvider;
 }
 public MovieLister(IMovieProvider movieProvider, ICountryFilter countryFilter)
 {
     this.MovieProvider = movieProvider;
     this.CountryFilter = countryFilter;
 }
 public void Initialize(IMovieProvider provider, ICountryFilter filter)
 {
     this.movieProvider = provider;
     this.countryFilter = filter;
 }
示例#20
0
 public HomeController(IMovieProvider movieProvider)
 {
     _movieProvider = movieProvider;
 }
示例#21
0
 public MoviesController(IMovieProvider movieProvider)
 {
     this.MovieProvider = movieProvider;
 }