public ProviderViewModel(IMovieProvider movieProvider) { _movieProvider = movieProvider; Name = _movieProvider.Name; Description = _movieProvider.Description; }
public MovieModelBuilder( IMovieRequestBuilder movieRequestBuilder, IMovieProvider searchProvider) { _movieRequestBuilder = movieRequestBuilder ?? throw new ArgumentNullException(nameof(movieRequestBuilder)); _searchProvider = searchProvider ?? throw new ArgumentNullException(nameof(searchProvider)); }
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()); }
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()); }
public MovieModule(IMovieProvider provider) { Get("/movies/{id}", args => { int id = int.Parse(args.id); return(Response.AsJson(provider.GetById((id)))); }); }
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); }
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()); }
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; }
public HomeController(IConfiguration configuration, IMovieProvider movieProvider) { ApplicationSettings.WebApiUrl = configuration.GetValue <string>("MySettings:WebApiBaseUrl"); _apikey = configuration.GetValue <string>("MySettings:ApiKey"); _movieProvider = movieProvider; }
// private MovieProvider _movieProvider = new MovieProvider(); public MovieController(IMovieProvider movieProvider) { _movieProvider = movieProvider; }
public void Enqueue(IMovieProvider sender, Uri uri) { Enqueue(uri); EnqueueCompleted(); }
public void InjectMovieProvider(IMovieProvider provider) { movieProvider = provider; }
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; }
public HomeController(IMovieProvider movieProvider) { _movieProvider = movieProvider; }
public MoviesController(IMovieProvider movieProvider) { this.MovieProvider = movieProvider; }