public void SortMovies(string i_SelectedValue) { if (MoviesFound.Count > 1) { var filterd = MoviesFound.ToList(); if (i_SelectedValue == "By Year") { filterd = filterd.OrderByDescending(w => w.ReleasedYear).ToList(); } if (i_SelectedValue == "By Rating") { filterd = filterd.OrderByDescending(w => w.Rating).ToList(); } if (i_SelectedValue == "By Genre") { filterd = filterd.OrderBy(w => w.Genre).ToList(); } MoviesFound.Clear(); foreach (var item in filterd) { MoviesFound.Add(item); } } }
private void foundAMovie(int i_MovieId, FileInfo i_Path) { Movie movie = new Movie(); movie.ApiMovie = m_Client.GetMovieAsync(i_MovieId).Result; movie.InitializeClass(); movie.FilePath = i_Path.FilePath; movie.CuttedFileName = i_Path.FileName; if (!MoviesFound.Any(n => n.Title == movie.Title)) { MoviesFound.Add(movie); } }