示例#1
0
        private IEnumerable <IndexerRequest> GetRequest(TorrentQuery query)
        {
            var request = new HttpRequestBuilder(Settings.BaseUrl)
                          .Resource("/api/torrents")
                          .Build();

            request.Method = HttpMethod.POST;
            const string appJson = "application/json";

            request.Headers.Accept      = appJson;
            request.Headers.ContentType = appJson;

            query.Username = Settings.Username;
            query.Passkey  = Settings.ApiKey;

            query.Category = Settings.Categories.ToArray();
            query.Codec    = Settings.Codecs.ToArray();
            query.Medium   = Settings.Mediums.ToArray();

            // Require Internal only if came from RSS sync
            if (Settings.RequireInternal && query.ImdbInfo == null)
            {
                query.Origin = 1;
            }

            request.SetContent(query.ToJson());

            yield return(new IndexerRequest(request));
        }
示例#2
0
        private IEnumerable <IndexerRequest> GetRequest(TorrentQuery query)
        {
            var builder = new HttpRequestBuilder(Settings.BaseUrl);
            var request = builder.Build("/api/torrents");

            request.Method = HttpMethod.POST;
            const string appJson = "application/json";

            request.Headers.Accept      = appJson;
            request.Headers.ContentType = appJson;

            query.Username = Settings.Username;
            query.Passkey  = Settings.ApiKey;

            request.Body = query.ToJson();

            yield return(new IndexerRequest(request));
        }
        private IEnumerable <IndexerRequest> GetRequest(TorrentQuery query)
        {
            var request = new HttpRequestBuilder(Settings.BaseUrl)
                          .Resource("/api/torrents")
                          .Build();

            request.Method = HttpMethod.Post;
            const string appJson = "application/json";

            request.Headers.Accept      = appJson;
            request.Headers.ContentType = appJson;

            query.Username = Settings.Username;
            query.Passkey  = Settings.ApiKey;

            query.Codec  = Settings.Codecs.ToArray();
            query.Medium = Settings.Mediums.ToArray();

            request.SetContent(query.ToJson());

            yield return(new IndexerRequest(request));
        }
        private IEnumerable<IndexerRequest> GetRequest(TorrentQuery query)
        {
            var request = new HttpRequestBuilder(Settings.BaseUrl)
                .Resource("/api/torrents")
                .Build();

            request.Method = HttpMethod.POST;
            const string appJson = "application/json";
            request.Headers.Accept = appJson;
            request.Headers.ContentType = appJson;

            query.Username = Settings.Username;
            query.Passkey = Settings.ApiKey;

            request.SetContent(query.ToJson());

            yield return new IndexerRequest(request);
        }