Exemple #1
0
        /// <summary>
        /// Function for searching movies
        /// </summary>
        /// <param name="keyword">The keywords to search for</param>
        /// <param name="page">The number of page requested</param>
        /// <returns></returns>
        public async Task SearchMovie(string keyword, int page)
        {
            this.Displayables.Clear();
            this.SearchString = keyword;
            this.WasSearched  = true;
            this.HeaderString = "Keresés...";
            var movieService   = new MovieServices();
            var searchedMovies = await movieService.GetMoviesBySearchAsync(keyword, page);

            if (searchedMovies.movies.Count == 0)
            {
                this.HeaderString = "Nincs találat a keresésre";
            }
            else
            {
                foreach (var movie in searchedMovies.movies)
                {
                    movie.poster_path = "https://image.tmdb.org/t/p/w500/" + movie.poster_path;
                    this.Displayables.Add(new TvSeriesOrMovieDisplaySmall(true, movie.poster_path, movie.Title, movie.id));
                }
                this.HeaderString = $"{searchedMovies.movies.Count} találat van";
            }
            this.SeachPagesCount = searchedMovies.total_pages;
        }