Initial commit

This commit is contained in:
zone117x
2015-04-13 00:25:21 -06:00
parent cdc829cece
commit 2fd026b7d4
25 changed files with 1556 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Jackett
{
public class TorznabQuery
{
public string QueryType { get; private set; }
public string[] Categories { get; private set; }
public int Extended { get; private set; }
public string ApiKey { get; private set; }
public int Limit { get; private set; }
public int Offset { get; private set; }
public int RageID { get; private set; }
public int Season { get; private set; }
public int Episode { get; private set; }
public static TorznabQuery FromHttpQuery(NameValueCollection query)
{
//{t=tvsearch&cat=5030%2c5040&extended=1&apikey=test&offset=0&limit=100&rid=24493&season=5&ep=1}
var q = new TorznabQuery();
q.QueryType = query["t"];
q.Categories = query["cat"].Split(',');
q.Extended = int.Parse(query["extended"]);
q.ApiKey = query["apikey"];
q.Limit = int.Parse(query["limit"]);
q.Offset = int.Parse(query["offset"]);
q.RageID = int.Parse(query["rid"]);
q.Season = int.Parse(query["season"]);
q.Episode = int.Parse(query["ep"]);
return q;
}
}
}