diff --git a/src/Jackett/Utils/StringUtil.cs b/src/Jackett/Utils/StringUtil.cs index 3ca9a8c09..bd51f24be 100644 --- a/src/Jackett/Utils/StringUtil.cs +++ b/src/Jackett/Utils/StringUtil.cs @@ -96,6 +96,18 @@ namespace Jackett.Utils return string.Join("&", collection.AllKeys.Select(a => a + "=" + HttpUtility.UrlEncode(collection[a], encoding))); } + public static string GetQueryString(this ICollection> collection, Encoding encoding = null) + { + if (encoding == null) + encoding = Encoding.UTF8; + return string.Join("&", collection.Select(a => a.Key + "=" + HttpUtility.UrlEncode(a.Value, encoding))); + } + + public static void Add(this ICollection> collection, string key, string value) + { + collection.Add(new KeyValuePair(key, value)); + } + public static string ToHtmlPretty(this IElement element) { if (element == null)