private IEnumerable <IndexerRequest> GetPagedRequests(string mode, int?tvdbId, string query, params object[] args) { var httpRequest = new HttpRequest(Settings.BaseUrl + "/pubapi_v2.php", HttpAccept.Json); httpRequest.AddQueryParam("mode", mode); if (tvdbId.HasValue) { httpRequest.AddQueryParam("search_tvdb", tvdbId.Value.ToString()); } if (query.IsNotNullOrWhiteSpace()) { httpRequest.AddQueryParam("search_string", string.Format(query, args)); } if (!Settings.RankedOnly) { httpRequest.AddQueryParam("ranked", "0"); } httpRequest.AddQueryParam("category", "18;41"); httpRequest.AddQueryParam("limit", "100"); httpRequest.AddQueryParam("token", _tokenProvider.GetToken(Settings)); httpRequest.AddQueryParam("format", "json_extended"); httpRequest.AddQueryParam("app_id", "Sonarr"); yield return(new IndexerRequest(httpRequest)); }