diff options
| author | Claus Vium <clausvium@gmail.com> | 2019-02-27 12:45:06 +0100 |
|---|---|---|
| committer | Claus Vium <clausvium@gmail.com> | 2019-02-27 12:45:06 +0100 |
| commit | 91afaaf8fe43035bb4832da44b6d6741d2815fb5 (patch) | |
| tree | 6531dc4b7704fb746167431489ec15871ad47fd8 | |
| parent | 333bd2107a05c656b8fe27364dcd05fc7ca249d5 (diff) | |
Cleanup in QueryParamCollection
| -rw-r--r-- | Emby.Dlna/PlayTo/PlayToController.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Model/Services/QueryParamCollection.cs | 59 |
2 files changed, 2 insertions, 59 deletions
diff --git a/Emby.Dlna/PlayTo/PlayToController.cs b/Emby.Dlna/PlayTo/PlayToController.cs index be6810d0e..2da8bb860 100644 --- a/Emby.Dlna/PlayTo/PlayToController.cs +++ b/Emby.Dlna/PlayTo/PlayToController.cs @@ -849,7 +849,7 @@ namespace Emby.Dlna.PlayTo if (index == -1) return request; var query = url.Substring(index + 1); - var values = QueryHelpers.ParseQuery(query); + Dictionary<string, StringValues> values = QueryHelpers.ParseQuery(query); request.DeviceProfileId = values["DeviceProfileId"].ToString(); request.DeviceId = values["DeviceId"].ToString(); diff --git a/MediaBrowser.Model/Services/QueryParamCollection.cs b/MediaBrowser.Model/Services/QueryParamCollection.cs index 09806ed9c..9f23b2420 100644 --- a/MediaBrowser.Model/Services/QueryParamCollection.cs +++ b/MediaBrowser.Model/Services/QueryParamCollection.cs @@ -16,7 +16,7 @@ namespace MediaBrowser.Model.Services } - public QueryParamCollection(IDictionary<string, string> headers) + public QueryParamCollection(IHeaderDictionary headers) { foreach (var pair in headers) { @@ -24,38 +24,6 @@ namespace MediaBrowser.Model.Services } } - public QueryParamCollection(Microsoft.AspNetCore.Http.IHeaderDictionary headers) - { - foreach (var pair in headers) - { - Add(pair.Key, pair.Value); - } - } - - // 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); - } - } - } - public QueryParamCollection(IQueryCollection queryCollection) { foreach (var pair in queryCollection) @@ -74,21 +42,6 @@ namespace MediaBrowser.Model.Services return StringComparer.OrdinalIgnoreCase; } - public string GetKey(int index) - { - return this[index].Name; - } - - public string Get(int index) - { - return this[index].Value; - } - - public virtual string[] GetValues(int index) - { - return new[] { Get(index) }; - } - /// <summary> /// Adds a new query parameter. /// </summary> @@ -129,16 +82,6 @@ namespace MediaBrowser.Model.Services Add(key, value); } - /// <summary> - /// Removes all parameters of the given name. - /// </summary> - /// <returns>The number of parameters that were removed</returns> - /// <exception cref="ArgumentNullException"><paramref name="name" /> is null.</exception> - public virtual int Remove(string name) - { - return RemoveAll(p => p.Name == name); - } - public string Get(string name) { var stringComparison = GetStringComparison(); |
