aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
authorClaus Vium <clausvium@gmail.com>2019-02-21 10:07:21 +0100
committerClaus Vium <clausvium@gmail.com>2019-02-26 22:11:21 +0100
commit4db31acff940dc9cabbd39649103faf4dc2e2c47 (patch)
tree4472b2330124f2bfea3f9dcdfcd5508cedd84570 /MediaBrowser.Model
parent968e282c907f57d7998b6435cadae2f0a5ec832c (diff)
Begin removing System.Net sources
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Services/IRequest.cs2
-rw-r--r--MediaBrowser.Model/Services/QueryParamCollection.cs31
2 files changed, 32 insertions, 1 deletions
diff --git a/MediaBrowser.Model/Services/IRequest.cs b/MediaBrowser.Model/Services/IRequest.cs
index ac9b981b9..909cebce3 100644
--- a/MediaBrowser.Model/Services/IRequest.cs
+++ b/MediaBrowser.Model/Services/IRequest.cs
@@ -152,7 +152,7 @@ namespace MediaBrowser.Model.Services
QueryParamCollection Headers { get; }
- Task TransmitFile(string path, long offset, long count, FileShareMode fileShareMode, CancellationToken cancellationToken);
+ Task TransmitFile(string path, long offset, long count, FileShareMode fileShareMode, IFileSystem fileSystem, IStreamHelper streamHelper, CancellationToken cancellationToken);
bool SendChunked { get; set; }
}
diff --git a/MediaBrowser.Model/Services/QueryParamCollection.cs b/MediaBrowser.Model/Services/QueryParamCollection.cs
index 4297b97c6..0e0ebf848 100644
--- a/MediaBrowser.Model/Services/QueryParamCollection.cs
+++ b/MediaBrowser.Model/Services/QueryParamCollection.cs
@@ -1,10 +1,13 @@
using System;
using System.Collections.Generic;
+using System.Collections.Specialized;
using System.Linq;
+using System.Net;
using MediaBrowser.Model.Dto;
namespace MediaBrowser.Model.Services
{
+ // Remove this garbage class, it's just a bastard copy of NameValueCollection
public class QueryParamCollection : List<NameValuePair>
{
public QueryParamCollection()
@@ -20,6 +23,30 @@ namespace MediaBrowser.Model.Services
}
}
+ // TODO remove this shit
+ public QueryParamCollection(WebHeaderCollection webHeaderCollection)
+ {
+ foreach (var key in webHeaderCollection.AllKeys)
+ {
+ foreach (var value in webHeaderCollection.GetValues(key) ?? Array.Empty<string>())
+ {
+ Add(key, value);
+ }
+ }
+ }
+
+ // TODO remove this shit
+ public QueryParamCollection(NameValueCollection nameValueCollection)
+ {
+ foreach (var key in nameValueCollection.AllKeys)
+ {
+ foreach (var value in nameValueCollection.GetValues(key) ?? Array.Empty<string>())
+ {
+ Add(key, value);
+ }
+ }
+ }
+
private static StringComparison GetStringComparison()
{
return StringComparison.OrdinalIgnoreCase;
@@ -50,6 +77,10 @@ namespace MediaBrowser.Model.Services
/// </summary>
public virtual void Add(string key, string value)
{
+ if (string.Equals(key, "content-length", StringComparison.OrdinalIgnoreCase))
+ {
+ return;
+ }
Add(new NameValuePair(key, value));
}