mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-29 13:27:56 +02:00
Implement BakaBT, change Console to not build as x64, Add test framework
This commit is contained in:
@@ -19,6 +19,56 @@ namespace Jackett.Utils.Clients
|
||||
public string Cookies { get; set; }
|
||||
public string Referer { get; set; }
|
||||
public RequestType Type { get; set; }
|
||||
|
||||
public override bool Equals(System.Object obj)
|
||||
{
|
||||
if(obj is WebRequest)
|
||||
{
|
||||
var other = obj as WebRequest;
|
||||
var postDataSame = PostData == null && other.PostData == null;
|
||||
if (!postDataSame)
|
||||
{
|
||||
if (!(PostData == null || other.PostData == null))
|
||||
{
|
||||
var ok = PostData.Count == other.PostData.Count;
|
||||
foreach(var i in PostData)
|
||||
{
|
||||
if (!other.PostData.ContainsKey(i.Key))
|
||||
{
|
||||
ok = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if(PostData[i.Key] != other.PostData[i.Key])
|
||||
{
|
||||
ok = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ok)
|
||||
{
|
||||
postDataSame = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return other.Url == Url &&
|
||||
other.Referer == Referer &&
|
||||
other.Cookies == Cookies &&
|
||||
other.Type == Type &&
|
||||
postDataSame;
|
||||
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
public enum RequestType
|
||||
|
Reference in New Issue
Block a user