示例#1
0
 /// <summary>
 /// Search or list movies in YTS
 /// </summary>
 /// <param name="queryTerm">Term to search</param>
 /// <param name="quality">Quality of the release Ex: 720p, 1080p, 3D</param>
 /// <param name="genre">Genre of the movie (See http://www.imdb.com/genre/ for full list)</param>
 /// <param name="minimumRating">Minimum rating of the movie. Ex: 0 to 9</param>
 /// <param name="limit">The limit of results per page. Ex: 20</param>
 /// <param name="page">Page number to view the movies Ex: Limit 15 and Page 2 will show you movies 15 to 30</param>
 /// <param name="sortBy">Sorts the results by chosen field</param>
 /// <param name="orderBy">Order of the results in Ascending or Descending order</param>
 /// <returns>Collection of ListMovie class objects</returns>
 /// <exception cref="YifyLib.YifyException">If any errors occurred YTS process</exception>
 public List <ListMovie> ListMovies(
     string queryTerm        = "",
     string quality          = "All",
     string genre            = "",
     uint minimumRating      = 0,
     uint limit              = 20,
     uint page               = 1,
     SearchResultSort sortBy = SearchResultSort.DateAdded,
     SortOrder orderBy       = SortOrder.Desc)
 {
     try
     {
         var uri = YifyAPI.GetListMovieURI(queryTerm, quality, genre, minimumRating, limit, page, sortBy, orderBy);
         var res = YifyAPI.SendGetRequest(uri);
         return(_parser.ParseListMovieResponse(res));
     }
     catch (Exception ex)
     {
         throw new YifyException("An error occurred. See inner exception for more details", ex);
     }
 }