예제 #1
0
        public async Task LoadData()
        {
            LoadedPages++;
            var results = await Task.Run(() => TMDBService.Search(Query["query"], LoadedPages, 1));

            foreach (var v in results.OnlyWithImages())
            {
                Results.Add(v);
                if (v.media_type.Equals("movie"))
                {
                    Movies.Add(v);
                }
                if (v.media_type.Equals("tv"))
                {
                    Shows.Add(v);
                }
                if (v.media_type.Equals("person"))
                {
                    People.Add(v);
                }
            }

            if (results.Count != 0)
            {
                LoadedMore();
            }
            else
            {
                NoMore();
            }
        }
예제 #2
0
        public async Task LoadSearchResultNames(string query)
        {
            var searchresultnames = await Task.Run(() => TMDBService.Search(query));

            SearchResultNames.Clear();

            if (searched)
            {
                return;
            }
            foreach (var v in searchresultnames)
            {
                SearchResultNames.Add(v);
            }
        }