public async Task OnGet(string id) { backDrop = History.GetBackDrop(); History.CastID = Convert.ToInt32(id); movieID = History.GetMovieID(); await Program.Fetch.GrabCastBioAsync(id); string bioData = Program.Fetch.Bios; string movieCredits = Program.Fetch.movieCredits; JsonNinja bNinja = new JsonNinja(bioData); bios = bNinja.GetDetails("\"biography\""); name = bNinja.GetDetails("\"name\"")[0]; bio = ((bios[0].Replace("\n", "")).Replace("\\", "")).Replace(".nn", ". "); castImg = bNinja.GetPosters("\"profile_path\""); img = castImg[0]; bNinja = new JsonNinja(movieCredits); List <string> cast = bNinja.GetDetails("\"cast\""); bNinja = new JsonNinja(cast[0]); vote = bNinja.GetIds("\"vote_average\""); movieId = bNinja.GetIds("\"id\""); posterPaths = bNinja.GetDetails("\"poster_path\""); titles = bNinja.GetDetails("\"original_title\""); }
private async Task ShowPoster(string search) { await Program.Fetch.GrabPosterAsync(search); if (Program.Fetch.Data == null) { emptySearch = true; } else { jNinja = new JsonNinja(Program.Fetch.Data); List <string> names = jNinja.GetNames(); List <string> vals = jNinja.GetVals(); if (vals[1] == "0") { invalidSearch = true; } else { filter = jNinja.GetDetails("\"results\""); jNinja = new JsonNinja(filter[0]); posterPath = jNinja.GetPosters("\"poster_path\""); id = jNinja.GetIds("\"id\""); } } }