From ec1f5dc317182582ebff843c9e8a4d5277405469 Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Sun, 6 Jan 2019 21:50:43 +0100 Subject: Mayor code cleanup Add Argument*Exceptions now use proper nameof operators. Added exception messages to quite a few Argument*Exceptions. Fixed rethorwing to be proper syntax. Added a ton of null checkes. (This is only a start, there are about 500 places that need proper null handling) Added some TODOs to log certain exceptions. Fix sln again. Fixed all AssemblyInfo's and added proper copyright (where I could find them) We live in *current year*. Fixed the use of braces. Fixed a ton of properties, and made a fair amount of functions static that should be and can be static. Made more Methods that should be static static. You can now use static to find bad functions! Removed unused variable. And added one more proper XML comment. --- Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs') diff --git a/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs b/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs index 9b22b7773..d42184f8e 100644 --- a/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs +++ b/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs @@ -1,4 +1,4 @@ -using Emby.Dlna.Common; +using Emby.Dlna.Common; using System.Collections.Generic; namespace Emby.Dlna.ConnectionManager @@ -19,7 +19,7 @@ namespace Emby.Dlna.ConnectionManager return list; } - private ServiceAction PrepareForConnection() + private static ServiceAction PrepareForConnection() { var action = new ServiceAction { @@ -78,7 +78,7 @@ namespace Emby.Dlna.ConnectionManager return action; } - private ServiceAction GetCurrentConnectionInfo() + private static ServiceAction GetCurrentConnectionInfo() { var action = new ServiceAction { -- cgit v1.2.3 From 846456b41e87c8ccced544298b80a27d0f199215 Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Sat, 12 Jan 2019 21:41:08 +0100 Subject: Reformatted the files with notes. --- .../ConnectionManager/ServiceActionListBuilder.cs | 2 +- Emby.Naming/Video/VideoListResolver.cs | 4 +- Emby.Server.Implementations/Devices/DeviceId.cs | 7 +- .../LiveTv/LiveTvDtoService.cs | 2 +- .../TunerHosts/HdHomerun/HdHomerunUdpStream.cs | 2 +- .../Playlists/PlaylistManager.cs | 2 +- .../ScheduledTasks/ScheduledTaskWorker.cs | 3 +- .../Services/ServicePath.cs | 3 +- .../Sorting/SeriesSortNameComparer.cs | 4 +- .../NLangDetect/Extensions/StringExtensions.cs | 38 ++--- MediaBrowser.Api/Playback/BaseStreamingService.cs | 8 +- MediaBrowser.Controller/Entities/PeopleHelper.cs | 4 +- MediaBrowser.Controller/Library/ItemResolveArgs.cs | 4 +- MediaBrowser.Providers/Omdb/OmdbProvider.cs | 4 +- MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs | 4 +- RSSDP/DeviceEventArgs.cs | 18 +-- RSSDP/DeviceUnavailableEventArgs.cs | 106 +++++++------- RSSDP/HttpRequestParser.cs | 130 ++++++++--------- RSSDP/HttpResponseParser.cs | 154 ++++++++++----------- RSSDP/IEnumerableExtensions.cs | 14 +- 20 files changed, 257 insertions(+), 256 deletions(-) (limited to 'Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs') diff --git a/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs b/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs index d42184f8e..674bc4c8e 100644 --- a/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs +++ b/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs @@ -77,7 +77,7 @@ namespace Emby.Dlna.ConnectionManager return action; } - + private static ServiceAction GetCurrentConnectionInfo() { var action = new ServiceAction diff --git a/Emby.Naming/Video/VideoListResolver.cs b/Emby.Naming/Video/VideoListResolver.cs index aa4bb6127..45d4593de 100644 --- a/Emby.Naming/Video/VideoListResolver.cs +++ b/Emby.Naming/Video/VideoListResolver.cs @@ -1,4 +1,4 @@ -using Emby.Naming.Common; +using Emby.Naming.Common; using System; using System.Collections.Generic; using System.IO; @@ -236,7 +236,7 @@ namespace Emby.Naming.Video if (testFilename.StartsWith(folderName, StringComparison.OrdinalIgnoreCase)) { testFilename = testFilename.Substring(folderName.Length).Trim(); - return testFilename.StartsWith("-", StringComparison.OrdinalIgnoreCase)||Regex.Replace(testFilename, @"\[([^]]*)\]", "").Trim() == string.Empty; + return testFilename.StartsWith("-", StringComparison.OrdinalIgnoreCase) || Regex.Replace(testFilename, @"\[([^]]*)\]", "").Trim() == string.Empty; } return false; diff --git a/Emby.Server.Implementations/Devices/DeviceId.cs b/Emby.Server.Implementations/Devices/DeviceId.cs index 5630d7d3c..4f5950ac7 100644 --- a/Emby.Server.Implementations/Devices/DeviceId.cs +++ b/Emby.Server.Implementations/Devices/DeviceId.cs @@ -89,9 +89,10 @@ namespace Emby.Server.Implementations.Devices public DeviceId(IApplicationPaths appPaths, ILogger logger, IFileSystem fileSystem) { - if (fileSystem == null) { - throw new ArgumentNullException(nameof(fileSystem)); - } + if (fileSystem == null) + { + throw new ArgumentNullException(nameof(fileSystem)); + } _appPaths = appPaths; _logger = logger; diff --git a/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs b/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs index dbc7b16a2..7397d4b60 100644 --- a/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs +++ b/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs @@ -332,7 +332,7 @@ namespace Emby.Server.Implementations.LiveTv { try { - dto.ParentBackdropImageTags = new [] + dto.ParentBackdropImageTags = new[] { _imageProcessor.GetImageCacheTag(program, image) }; diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs index 1a33154f8..fd78dfa8e 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs @@ -207,7 +207,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun throw new ArgumentNullException(nameof(buffer)); if (offset + count < 0) - throw new ArgumentOutOfRangeException(nameof(offset),"offset + count must not be negative"); + throw new ArgumentOutOfRangeException(nameof(offset), "offset + count must not be negative"); if (offset + count > buffer.Length) throw new ArgumentException("offset + count must not be greater than the length of buffer"); diff --git a/Emby.Server.Implementations/Playlists/PlaylistManager.cs b/Emby.Server.Implementations/Playlists/PlaylistManager.cs index a5fa24fc8..38fbac030 100644 --- a/Emby.Server.Implementations/Playlists/PlaylistManager.cs +++ b/Emby.Server.Implementations/Playlists/PlaylistManager.cs @@ -459,7 +459,7 @@ namespace Emby.Server.Implementations.Playlists { if (string.IsNullOrEmpty(folderPath)) { - throw new ArgumentException("Folder path was null or empty.",nameof(folderPath)); + throw new ArgumentException("Folder path was null or empty.", nameof(folderPath)); } if (string.IsNullOrEmpty(fileAbsolutePath)) diff --git a/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs b/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs index 602eeb29b..c8d6f2022 100644 --- a/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs +++ b/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -29,7 +29,6 @@ namespace Emby.Server.Implementations.ScheduledTasks /// The scheduled task. public IScheduledTask ScheduledTask { get; private set; } - /// /// Gets or sets the json serializer. /// /// The json serializer. diff --git a/Emby.Server.Implementations/Services/ServicePath.cs b/Emby.Server.Implementations/Services/ServicePath.cs index 4c98a3388..0222b3782 100644 --- a/Emby.Server.Implementations/Services/ServicePath.cs +++ b/Emby.Server.Implementations/Services/ServicePath.cs @@ -116,7 +116,6 @@ namespace Emby.Server.Implementations.Services { if (string.IsNullOrEmpty(component)) continue; - if (StringContains(component, VariablePrefix) && component.IndexOf(ComponentSeperator) != -1) { @@ -352,7 +351,7 @@ namespace Emby.Server.Implementations.Services if (withPathInfoParts.Length != this.PathComponentsCount && !this.IsWildCardPath) { - return false; + return false; } if (!Verbs.Contains(httpMethod, StringComparer.OrdinalIgnoreCase)) diff --git a/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs b/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs index 32a8f6b45..1bbe30b95 100644 --- a/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs +++ b/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Sorting; using MediaBrowser.Model.Querying; using System; @@ -24,7 +24,7 @@ namespace Emby.Server.Implementations.Sorting return hasSeries != null ? hasSeries.FindSeriesSortName() : null; } - + /// /// Gets the name. /// diff --git a/Emby.Server.Implementations/TextEncoding/NLangDetect/Extensions/StringExtensions.cs b/Emby.Server.Implementations/TextEncoding/NLangDetect/Extensions/StringExtensions.cs index c60757c02..5db68bbf1 100644 --- a/Emby.Server.Implementations/TextEncoding/NLangDetect/Extensions/StringExtensions.cs +++ b/Emby.Server.Implementations/TextEncoding/NLangDetect/Extensions/StringExtensions.cs @@ -1,25 +1,25 @@ -using System; +using System; namespace NLangDetect.Core.Extensions { - public static class StringExtensions - { - /// - /// Returns a new character sequence that is a subsequence of this sequence. The subsequence starts with the character at the specified index and ends with the character at index end - 1. The length of the returned sequence is end - start, so if start == end then an empty sequence is returned. - /// - /// - /// the start index, inclusive - /// the end index, exclusive - /// the specified subsequence - /// if start or end are negative, if end is greater than length(), or if start is greater than end - public static string SubSequence(this string s, int start, int end) + public static class StringExtensions { - if (start < 0) throw new ArgumentOutOfRangeException(nameof(start), "Argument must not be negative."); - if (end < 0) throw new ArgumentOutOfRangeException(nameof(end), "Argument must not be negative."); - if (end > s.Length) throw new ArgumentOutOfRangeException(nameof(end), "Argument must not be greater than the input string's length."); - if (start > end) throw new ArgumentOutOfRangeException(nameof(start), "Argument must not be greater than the 'end' argument."); - - return s.Substring(start, end - start); + /// + /// Returns a new character sequence that is a subsequence of this sequence. The subsequence starts with the character at the specified index and ends with the character at index end - 1. The length of the returned sequence is end - start, so if start == end then an empty sequence is returned. + /// + /// + /// the start index, inclusive + /// the end index, exclusive + /// the specified subsequence + /// if start or end are negative, if end is greater than length(), or if start is greater than end + public static string SubSequence(this string s, int start, int end) + { + if (start < 0) throw new ArgumentOutOfRangeException(nameof(start), "Argument must not be negative."); + if (end < 0) throw new ArgumentOutOfRangeException(nameof(end), "Argument must not be negative."); + if (end > s.Length) throw new ArgumentOutOfRangeException(nameof(end), "Argument must not be greater than the input string's length."); + if (start > end) throw new ArgumentOutOfRangeException(nameof(start), "Argument must not be greater than the 'end' argument."); + + return s.Substring(start, end - start); + } } - } } diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 2e423c31e..ba7f7070b 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Common.Extensions; +using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Devices; using MediaBrowser.Controller.Dlna; @@ -595,8 +595,10 @@ namespace MediaBrowser.Api.Playback /// The stream request. private void ParseStreamOptions(StreamRequest request) { - foreach (var param in Request.QueryString) { - if (char.IsLower(param.Name[0])) { + foreach (var param in Request.QueryString) + { + if (char.IsLower(param.Name[0])) + { // This was probably not parsed initially and should be a StreamOptions // TODO: This should be incorporated either in the lower framework for parsing requests // or the generated URL should correctly serialize it diff --git a/MediaBrowser.Controller/Entities/PeopleHelper.cs b/MediaBrowser.Controller/Entities/PeopleHelper.cs index 1f670b752..d09ef3a15 100644 --- a/MediaBrowser.Controller/Entities/PeopleHelper.cs +++ b/MediaBrowser.Controller/Entities/PeopleHelper.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Entities; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +16,7 @@ namespace MediaBrowser.Controller.Entities if (string.IsNullOrEmpty(person.Name)) { - throw new ArgumentException("The person's name was empty or null.",nameof(person)); + throw new ArgumentException("The person's name was empty or null.", nameof(person)); } // Normalize diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs index 387540b81..4d1a4ed2f 100644 --- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Providers; using System; using System.Collections.Generic; @@ -155,7 +155,7 @@ namespace MediaBrowser.Controller.Library { if (string.IsNullOrEmpty(path)) { - throw new ArgumentException("The path was empty or null.",nameof(path)); + throw new ArgumentException("The path was empty or null.", nameof(path)); } if (AdditionalLocations == null) diff --git a/MediaBrowser.Providers/Omdb/OmdbProvider.cs b/MediaBrowser.Providers/Omdb/OmdbProvider.cs index 8d99f7b7f..6aca093ec 100644 --- a/MediaBrowser.Providers/Omdb/OmdbProvider.cs +++ b/MediaBrowser.Providers/Omdb/OmdbProvider.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Model.IO; +using MediaBrowser.Model.IO; using MediaBrowser.Common.Net; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; @@ -320,7 +320,7 @@ namespace MediaBrowser.Providers.Omdb { if (string.IsNullOrWhiteSpace(seriesImdbId)) { - throw new ArgumentException("The series IMDb ID was null or whitespace.",nameof(seriesImdbId)); + throw new ArgumentException("The series IMDb ID was null or whitespace.", nameof(seriesImdbId)); } var imdbParam = seriesImdbId.StartsWith("tt", StringComparison.OrdinalIgnoreCase) ? seriesImdbId : "tt" + seriesImdbId; diff --git a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs index 4fdba39fa..5390f5049 100644 --- a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs +++ b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Common.Configuration; +using MediaBrowser.Common.Configuration; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; @@ -65,7 +65,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers if (string.IsNullOrEmpty(metadataFile)) { - throw new ArgumentException("The metadata file was empty or null.",nameof(metadataFile)); + throw new ArgumentException("The metadata file was empty or null.", nameof(metadataFile)); } var settings = XmlReaderSettingsFactory.Create(false); diff --git a/RSSDP/DeviceEventArgs.cs b/RSSDP/DeviceEventArgs.cs index 0212d1d7c..55b23b68c 100644 --- a/RSSDP/DeviceEventArgs.cs +++ b/RSSDP/DeviceEventArgs.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Text; @@ -18,14 +18,14 @@ namespace Rssdp #region Constructors - /// - /// Constructs a new instance for the specified . - /// - /// The associated with the event this argument class is being used for. - /// Thrown if the argument is null. - public DeviceEventArgs(SsdpDevice device) - { - if (device == null) throw new ArgumentNullException(nameof(device)); + /// + /// Constructs a new instance for the specified . + /// + /// The associated with the event this argument class is being used for. + /// Thrown if the argument is null. + public DeviceEventArgs(SsdpDevice device) + { + if (device == null) throw new ArgumentNullException(nameof(device)); _Device = device; } diff --git a/RSSDP/DeviceUnavailableEventArgs.cs b/RSSDP/DeviceUnavailableEventArgs.cs index e01248fa5..ecba7c013 100644 --- a/RSSDP/DeviceUnavailableEventArgs.cs +++ b/RSSDP/DeviceUnavailableEventArgs.cs @@ -1,59 +1,59 @@ -using System; +using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace Rssdp { - /// - /// Event arguments for the event. - /// - public sealed class DeviceUnavailableEventArgs : EventArgs - { - - #region Fields - - private readonly DiscoveredSsdpDevice _DiscoveredDevice; - private readonly bool _Expired; - - #endregion - - #region Constructors - - /// - /// Full constructor. - /// - /// A instance representing the device that has become unavailable. - /// A boolean value indicating whether this device is unavailable because it expired, or because it explicitly sent a byebye notification.. See for more detail. - /// Thrown if the parameter is null. - public DeviceUnavailableEventArgs(DiscoveredSsdpDevice discoveredDevice, bool expired) - { - if (discoveredDevice == null) throw new ArgumentNullException(nameof(discoveredDevice)); - - _DiscoveredDevice = discoveredDevice; - _Expired = expired; - } - - #endregion - - #region Public Properties - - /// - /// Returns true if the device is considered unavailable because it's cached information expired before a new alive notification or search result was received. Returns false if the device is unavailable because it sent an explicit notification of it's unavailability. - /// - public bool Expired - { - get { return _Expired; } - } - - /// - /// A reference to a instance containing the discovery details of the removed device. - /// - public DiscoveredSsdpDevice DiscoveredDevice - { - get { return _DiscoveredDevice; } - } - - #endregion - } -} \ No newline at end of file + /// + /// Event arguments for the event. + /// + public sealed class DeviceUnavailableEventArgs : EventArgs + { + + #region Fields + + private readonly DiscoveredSsdpDevice _DiscoveredDevice; + private readonly bool _Expired; + + #endregion + + #region Constructors + + /// + /// Full constructor. + /// + /// A instance representing the device that has become unavailable. + /// A boolean value indicating whether this device is unavailable because it expired, or because it explicitly sent a byebye notification.. See for more detail. + /// Thrown if the parameter is null. + public DeviceUnavailableEventArgs(DiscoveredSsdpDevice discoveredDevice, bool expired) + { + if (discoveredDevice == null) throw new ArgumentNullException(nameof(discoveredDevice)); + + _DiscoveredDevice = discoveredDevice; + _Expired = expired; + } + + #endregion + + #region Public Properties + + /// + /// Returns true if the device is considered unavailable because it's cached information expired before a new alive notification or search result was received. Returns false if the device is unavailable because it sent an explicit notification of it's unavailability. + /// + public bool Expired + { + get { return _Expired; } + } + + /// + /// A reference to a instance containing the discovery details of the removed device. + /// + public DiscoveredSsdpDevice DiscoveredDevice + { + get { return _DiscoveredDevice; } + } + + #endregion + } +} diff --git a/RSSDP/HttpRequestParser.cs b/RSSDP/HttpRequestParser.cs index 7d611dea8..1af7f0d51 100644 --- a/RSSDP/HttpRequestParser.cs +++ b/RSSDP/HttpRequestParser.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; @@ -8,70 +8,70 @@ using System.Threading.Tasks; namespace Rssdp.Infrastructure { - /// - /// Parses a string into a or throws an exception. - /// - public sealed class HttpRequestParser : HttpParserBase - { - - #region Fields & Constants - - private readonly string[] ContentHeaderNames = new string[] - { - "Allow", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-MD5", "Content-Range", "Content-Type", "Expires", "Last-Modified" - }; - - #endregion - - #region Public Methods - - /// - /// Parses the specified data into a instance. - /// - /// A string containing the data to parse. - /// A instance containing the parsed data. - public override System.Net.Http.HttpRequestMessage Parse(string data) - { - System.Net.Http.HttpRequestMessage retVal = null; - - try - { - retVal = new System.Net.Http.HttpRequestMessage(); - - Parse(retVal, retVal.Headers, data); - - return retVal; - } - finally - { - if (retVal != null) - retVal.Dispose(); - } - } - - #endregion - - #region Overrides - - /// - /// Used to parse the first line of an HTTP request or response and assign the values to the appropriate properties on the . - /// - /// The first line of the HTTP message to be parsed. - /// Either a or to assign the parsed values to. - protected override void ParseStatusLine(string data, HttpRequestMessage message) - { - if (data == null) throw new ArgumentNullException(nameof(data)); - if (message == null) throw new ArgumentNullException(nameof(message)); - - var parts = data.Split(' '); - if (parts.Length < 2) throw new ArgumentException("Status line is invalid. Insufficient status parts.", nameof(data)); - - message.Method = new HttpMethod(parts[0].Trim()); - Uri requestUri; - if (Uri.TryCreate(parts[1].Trim(), UriKind.RelativeOrAbsolute, out requestUri)) - message.RequestUri = requestUri; - else - System.Diagnostics.Debug.WriteLine(parts[1]); + /// + /// Parses a string into a or throws an exception. + /// + public sealed class HttpRequestParser : HttpParserBase + { + + #region Fields & Constants + + private readonly string[] ContentHeaderNames = new string[] + { + "Allow", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-MD5", "Content-Range", "Content-Type", "Expires", "Last-Modified" + }; + + #endregion + + #region Public Methods + + /// + /// Parses the specified data into a instance. + /// + /// A string containing the data to parse. + /// A instance containing the parsed data. + public override System.Net.Http.HttpRequestMessage Parse(string data) + { + System.Net.Http.HttpRequestMessage retVal = null; + + try + { + retVal = new System.Net.Http.HttpRequestMessage(); + + Parse(retVal, retVal.Headers, data); + + return retVal; + } + finally + { + if (retVal != null) + retVal.Dispose(); + } + } + + #endregion + + #region Overrides + + /// + /// Used to parse the first line of an HTTP request or response and assign the values to the appropriate properties on the . + /// + /// The first line of the HTTP message to be parsed. + /// Either a or to assign the parsed values to. + protected override void ParseStatusLine(string data, HttpRequestMessage message) + { + if (data == null) throw new ArgumentNullException(nameof(data)); + if (message == null) throw new ArgumentNullException(nameof(message)); + + var parts = data.Split(' '); + if (parts.Length < 2) throw new ArgumentException("Status line is invalid. Insufficient status parts.", nameof(data)); + + message.Method = new HttpMethod(parts[0].Trim()); + Uri requestUri; + if (Uri.TryCreate(parts[1].Trim(), UriKind.RelativeOrAbsolute, out requestUri)) + message.RequestUri = requestUri; + else + System.Diagnostics.Debug.WriteLine(parts[1]); if (parts.Length >= 3) { diff --git a/RSSDP/HttpResponseParser.cs b/RSSDP/HttpResponseParser.cs index 9c1373f74..d864a8bb7 100644 --- a/RSSDP/HttpResponseParser.cs +++ b/RSSDP/HttpResponseParser.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; @@ -8,82 +8,82 @@ using System.Threading.Tasks; namespace Rssdp.Infrastructure { - /// - /// Parses a string into a or throws an exception. - /// - public sealed class HttpResponseParser : HttpParserBase - { - - #region Fields & Constants - - private readonly string[] ContentHeaderNames = new string[] - { - "Allow", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-MD5", "Content-Range", "Content-Type", "Expires", "Last-Modified" - }; - - #endregion - - #region Public Methods - - /// - /// Parses the specified data into a instance. - /// - /// A string containing the data to parse. - /// A instance containing the parsed data. - public override HttpResponseMessage Parse(string data) - { - System.Net.Http.HttpResponseMessage retVal = null; - try - { - retVal = new System.Net.Http.HttpResponseMessage(); - - Parse(retVal, retVal.Headers, data); - - return retVal; - } - catch - { - if (retVal != null) - retVal.Dispose(); - - throw; - } - } - - #endregion - - #region Overrides Methods - - /// - /// Returns a boolean indicating whether the specified HTTP header name represents a content header (true), or a message header (false). - /// - /// A string containing the name of the header to return the type of. - /// A boolean, true if th specified header relates to HTTP content, otherwise false. - protected override bool IsContentHeader(string headerName) - { - return ContentHeaderNames.Contains(headerName, StringComparer.OrdinalIgnoreCase); - } - - /// - /// Used to parse the first line of an HTTP request or response and assign the values to the appropriate properties on the . - /// - /// The first line of the HTTP message to be parsed. - /// Either a or to assign the parsed values to. - protected override void ParseStatusLine(string data, HttpResponseMessage message) - { - if (data == null) throw new ArgumentNullException(nameof(data)); - if (message == null) throw new ArgumentNullException(nameof(message)); - - var parts = data.Split(' '); - if (parts.Length < 2) throw new ArgumentException("data status line is invalid. Insufficient status parts.", nameof(data)); - - message.Version = ParseHttpVersion(parts[0].Trim()); - - int statusCode = -1; - if (!Int32.TryParse(parts[1].Trim(), out statusCode)) - throw new ArgumentException("data status line is invalid. Status code is not a valid integer.", nameof(data)); - - message.StatusCode = (HttpStatusCode)statusCode; + /// + /// Parses a string into a or throws an exception. + /// + public sealed class HttpResponseParser : HttpParserBase + { + + #region Fields & Constants + + private readonly string[] ContentHeaderNames = new string[] + { + "Allow", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-MD5", "Content-Range", "Content-Type", "Expires", "Last-Modified" + }; + + #endregion + + #region Public Methods + + /// + /// Parses the specified data into a instance. + /// + /// A string containing the data to parse. + /// A instance containing the parsed data. + public override HttpResponseMessage Parse(string data) + { + System.Net.Http.HttpResponseMessage retVal = null; + try + { + retVal = new System.Net.Http.HttpResponseMessage(); + + Parse(retVal, retVal.Headers, data); + + return retVal; + } + catch + { + if (retVal != null) + retVal.Dispose(); + + throw; + } + } + + #endregion + + #region Overrides Methods + + /// + /// Returns a boolean indicating whether the specified HTTP header name represents a content header (true), or a message header (false). + /// + /// A string containing the name of the header to return the type of. + /// A boolean, true if th specified header relates to HTTP content, otherwise false. + protected override bool IsContentHeader(string headerName) + { + return ContentHeaderNames.Contains(headerName, StringComparer.OrdinalIgnoreCase); + } + + /// + /// Used to parse the first line of an HTTP request or response and assign the values to the appropriate properties on the . + /// + /// The first line of the HTTP message to be parsed. + /// Either a or to assign the parsed values to. + protected override void ParseStatusLine(string data, HttpResponseMessage message) + { + if (data == null) throw new ArgumentNullException(nameof(data)); + if (message == null) throw new ArgumentNullException(nameof(message)); + + var parts = data.Split(' '); + if (parts.Length < 2) throw new ArgumentException("data status line is invalid. Insufficient status parts.", nameof(data)); + + message.Version = ParseHttpVersion(parts[0].Trim()); + + int statusCode = -1; + if (!Int32.TryParse(parts[1].Trim(), out statusCode)) + throw new ArgumentException("data status line is invalid. Status code is not a valid integer.", nameof(data)); + + message.StatusCode = (HttpStatusCode)statusCode; if (parts.Length >= 3) { diff --git a/RSSDP/IEnumerableExtensions.cs b/RSSDP/IEnumerableExtensions.cs index 950d561b0..c96542dca 100644 --- a/RSSDP/IEnumerableExtensions.cs +++ b/RSSDP/IEnumerableExtensions.cs @@ -1,16 +1,16 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Rssdp.Infrastructure { - internal static class IEnumerableExtensions - { - public static IEnumerable SelectManyRecursive(this IEnumerable source, Func> selector) - { - if (source == null) throw new ArgumentNullException(nameof(source)); - if (selector == null) throw new ArgumentNullException(nameof(selector)); + internal static class IEnumerableExtensions + { + public static IEnumerable SelectManyRecursive(this IEnumerable source, Func> selector) + { + if (source == null) throw new ArgumentNullException(nameof(source)); + if (selector == null) throw new ArgumentNullException(nameof(selector)); return !source.Any() ? source : source.Concat( -- cgit v1.2.3 From 8bfb54a41bb8a145ab459e263e1904a2e98e7f66 Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Sun, 13 Jan 2019 20:16:19 +0100 Subject: Visual Studio Reformat: Emby.Dlna --- Emby.Dlna/Api/DlnaServerService.cs | 14 ++++---- Emby.Dlna/Common/Argument.cs | 6 ++-- Emby.Dlna/Common/StateVariable.cs | 3 +- Emby.Dlna/ConfigurationExtension.cs | 4 +-- Emby.Dlna/ConnectionManager/ConnectionManager.cs | 6 ++-- .../ConnectionManagerXmlBuilder.cs | 2 +- Emby.Dlna/ConnectionManager/ControlHandler.cs | 11 +++--- .../ConnectionManager/ServiceActionListBuilder.cs | 2 +- Emby.Dlna/ContentDirectory/ContentDirectory.cs | 12 +++---- .../ContentDirectory/ContentDirectoryXmlBuilder.cs | 2 +- Emby.Dlna/ContentDirectory/ControlHandler.cs | 39 ++++++++++------------ .../ContentDirectory/ServiceActionListBuilder.cs | 4 +-- Emby.Dlna/Didl/DidlBuilder.cs | 25 +++++++------- Emby.Dlna/Didl/Filter.cs | 5 ++- Emby.Dlna/Didl/StringWriterWithEncoding.cs | 2 -- Emby.Dlna/DlnaManager.cs | 24 ++++++------- Emby.Dlna/Eventing/EventManager.cs | 9 +++-- Emby.Dlna/Main/DlnaEntryPoint.cs | 20 +++++------ Emby.Dlna/MediaReceiverRegistrar/ControlHandler.cs | 9 +++-- .../MediaReceiverRegistrar.cs | 10 +++--- .../MediaReceiverRegistrarXmlBuilder.cs | 2 +- .../ServiceActionListBuilder.cs | 4 +-- Emby.Dlna/PlayTo/CurrentIdEventArgs.cs | 2 +- Emby.Dlna/PlayTo/Device.cs | 16 ++++----- Emby.Dlna/PlayTo/DeviceInfo.cs | 4 +-- Emby.Dlna/PlayTo/PlayToController.cs | 27 +++++++-------- Emby.Dlna/PlayTo/PlayToManager.cs | 21 +++++------- Emby.Dlna/PlayTo/PlaylistItemFactory.cs | 7 ++-- Emby.Dlna/PlayTo/SsdpHttpClient.cs | 8 ++--- Emby.Dlna/PlayTo/TransportCommands.cs | 2 +- Emby.Dlna/Profiles/DefaultProfile.cs | 6 ++-- Emby.Dlna/Profiles/DenonAvrProfile.cs | 1 - Emby.Dlna/Profiles/DirectTvProfile.cs | 1 - Emby.Dlna/Profiles/DishHopperJoeyProfile.cs | 1 - Emby.Dlna/Profiles/Foobar2000Profile.cs | 1 - Emby.Dlna/Profiles/LgTvProfile.cs | 1 - Emby.Dlna/Profiles/LinksysDMA2100Profile.cs | 3 +- Emby.Dlna/Profiles/MarantzProfile.cs | 3 +- Emby.Dlna/Profiles/MediaMonkeyProfile.cs | 5 ++- Emby.Dlna/Profiles/PanasonicVieraProfile.cs | 1 - Emby.Dlna/Profiles/PopcornHourProfile.cs | 1 - Emby.Dlna/Profiles/SamsungSmartTvProfile.cs | 1 - Emby.Dlna/Profiles/SharpSmartTvProfile.cs | 3 +- Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs | 1 - Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs | 1 - Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs | 1 - Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs | 1 - Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs | 1 - Emby.Dlna/Profiles/SonyBravia2010Profile.cs | 1 - Emby.Dlna/Profiles/SonyBravia2011Profile.cs | 1 - Emby.Dlna/Profiles/SonyBravia2012Profile.cs | 1 - Emby.Dlna/Profiles/SonyBravia2013Profile.cs | 1 - Emby.Dlna/Profiles/SonyBravia2014Profile.cs | 1 - Emby.Dlna/Profiles/SonyPs3Profile.cs | 1 - Emby.Dlna/Profiles/SonyPs4Profile.cs | 1 - Emby.Dlna/Profiles/WdtvLiveProfile.cs | 3 +- Emby.Dlna/Profiles/XboxOneProfile.cs | 1 - Emby.Dlna/Properties/AssemblyInfo.cs | 3 +- Emby.Dlna/Server/DescriptionXmlBuilder.cs | 7 ++-- Emby.Dlna/Service/BaseControlHandler.cs | 13 +++----- Emby.Dlna/Service/BaseService.cs | 5 ++- Emby.Dlna/Service/ControlErrorHandler.cs | 3 +- Emby.Dlna/Service/ServiceXmlBuilder.cs | 3 +- Emby.Dlna/Ssdp/DeviceDiscovery.cs | 13 ++------ Emby.Dlna/Ssdp/Extensions.cs | 5 +-- 65 files changed, 162 insertions(+), 236 deletions(-) (limited to 'Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs') diff --git a/Emby.Dlna/Api/DlnaServerService.cs b/Emby.Dlna/Api/DlnaServerService.cs index 194ae73e0..dd6607f9d 100644 --- a/Emby.Dlna/Api/DlnaServerService.cs +++ b/Emby.Dlna/Api/DlnaServerService.cs @@ -1,14 +1,14 @@ -using MediaBrowser.Controller.Dlna; -using System; +using System; using System.Collections.Generic; using System.IO; +using System.Linq; +using System.Text; using System.Threading.Tasks; -using MediaBrowser.Model.Services; +using Emby.Dlna.Main; using MediaBrowser.Common.Extensions; -using System.Text; +using MediaBrowser.Controller.Dlna; using MediaBrowser.Controller.Net; -using System.Linq; -using Emby.Dlna.Main; +using MediaBrowser.Model.Services; namespace Emby.Dlna.Api { @@ -227,7 +227,7 @@ namespace Emby.Dlna.Api // TODO: Work out what this is doing. if (string.Equals(first, "mediabrowser", StringComparison.OrdinalIgnoreCase) || string.Equals(first, "emby", StringComparison.OrdinalIgnoreCase) || - string.Equals(first, "jellyfin", StringComparison.OrdinalIgnoreCase )) + string.Equals(first, "jellyfin", StringComparison.OrdinalIgnoreCase)) { index++; } diff --git a/Emby.Dlna/Common/Argument.cs b/Emby.Dlna/Common/Argument.cs index e6a220a7f..4da6b4850 100644 --- a/Emby.Dlna/Common/Argument.cs +++ b/Emby.Dlna/Common/Argument.cs @@ -3,10 +3,10 @@ namespace Emby.Dlna.Common { public class Argument { - public string Name { get; set; } + public string Name { get; set; } - public string Direction { get; set; } + public string Direction { get; set; } - public string RelatedStateVariable { get; set; } + public string RelatedStateVariable { get; set; } } } diff --git a/Emby.Dlna/Common/StateVariable.cs b/Emby.Dlna/Common/StateVariable.cs index 571e17d06..92a943eed 100644 --- a/Emby.Dlna/Common/StateVariable.cs +++ b/Emby.Dlna/Common/StateVariable.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System; +using System; namespace Emby.Dlna.Common { diff --git a/Emby.Dlna/ConfigurationExtension.cs b/Emby.Dlna/ConfigurationExtension.cs index f19f0dfb5..82b2e0ba2 100644 --- a/Emby.Dlna/ConfigurationExtension.cs +++ b/Emby.Dlna/ConfigurationExtension.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Common.Configuration; +using System.Collections.Generic; using Emby.Dlna.Configuration; -using System.Collections.Generic; +using MediaBrowser.Common.Configuration; namespace Emby.Dlna { diff --git a/Emby.Dlna/ConnectionManager/ConnectionManager.cs b/Emby.Dlna/ConnectionManager/ConnectionManager.cs index ab747d189..e26d98d70 100644 --- a/Emby.Dlna/ConnectionManager/ConnectionManager.cs +++ b/Emby.Dlna/ConnectionManager/ConnectionManager.cs @@ -1,8 +1,8 @@ -using MediaBrowser.Common.Net; +using System.Collections.Generic; +using Emby.Dlna.Service; +using MediaBrowser.Common.Net; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Dlna; -using Emby.Dlna.Service; -using System.Collections.Generic; using MediaBrowser.Model.Xml; using Microsoft.Extensions.Logging; diff --git a/Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.cs b/Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.cs index db18025e6..f5873455a 100644 --- a/Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.cs +++ b/Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.cs @@ -1,6 +1,6 @@ +using System.Collections.Generic; using Emby.Dlna.Common; using Emby.Dlna.Service; -using System.Collections.Generic; namespace Emby.Dlna.ConnectionManager { diff --git a/Emby.Dlna/ConnectionManager/ControlHandler.cs b/Emby.Dlna/ConnectionManager/ControlHandler.cs index 7e3e5f650..a8c32fd99 100644 --- a/Emby.Dlna/ConnectionManager/ControlHandler.cs +++ b/Emby.Dlna/ConnectionManager/ControlHandler.cs @@ -1,12 +1,11 @@ -using MediaBrowser.Common.Extensions; -using MediaBrowser.Controller.Configuration; -using Emby.Dlna.Server; +using System; +using System.Collections.Generic; using Emby.Dlna.Service; +using MediaBrowser.Common.Extensions; +using MediaBrowser.Controller.Configuration; using MediaBrowser.Model.Dlna; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; using MediaBrowser.Model.Xml; +using Microsoft.Extensions.Logging; namespace Emby.Dlna.ConnectionManager { diff --git a/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs b/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs index 674bc4c8e..b7727b558 100644 --- a/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs +++ b/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs @@ -1,5 +1,5 @@ -using Emby.Dlna.Common; using System.Collections.Generic; +using Emby.Dlna.Common; namespace Emby.Dlna.ConnectionManager { diff --git a/Emby.Dlna/ContentDirectory/ContentDirectory.cs b/Emby.Dlna/ContentDirectory/ContentDirectory.cs index 7c809a952..217b8cfce 100644 --- a/Emby.Dlna/ContentDirectory/ContentDirectory.cs +++ b/Emby.Dlna/ContentDirectory/ContentDirectory.cs @@ -1,18 +1,18 @@ -using MediaBrowser.Common.Net; +using System; +using System.Collections.Generic; +using Emby.Dlna.Service; +using MediaBrowser.Common.Net; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Dlna; using MediaBrowser.Controller.Drawing; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; -using Emby.Dlna.Service; -using MediaBrowser.Model.Dlna; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.TV; +using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Xml; +using Microsoft.Extensions.Logging; namespace Emby.Dlna.ContentDirectory { diff --git a/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs b/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs index 2695a5433..15fdb36c4 100644 --- a/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs +++ b/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs @@ -1,6 +1,6 @@ +using System.Collections.Generic; using Emby.Dlna.Common; using Emby.Dlna.Service; -using System.Collections.Generic; namespace Emby.Dlna.ContentDirectory { diff --git a/Emby.Dlna/ContentDirectory/ControlHandler.cs b/Emby.Dlna/ContentDirectory/ControlHandler.cs index 57d4078a5..97ae50245 100644 --- a/Emby.Dlna/ContentDirectory/ControlHandler.cs +++ b/Emby.Dlna/ContentDirectory/ControlHandler.cs @@ -1,37 +1,32 @@ -using MediaBrowser.Common.Extensions; -using MediaBrowser.Controller.Channels; -using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.Drawing; -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Entities.Movies; -using MediaBrowser.Controller.Entities.TV; -using MediaBrowser.Controller.Library; -using Emby.Dlna.Didl; -using Emby.Dlna.Server; -using Emby.Dlna.Service; -using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Dlna; -using MediaBrowser.Model.Entities; -using Microsoft.Extensions.Logging; -using MediaBrowser.Model.Querying; -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; using System.Text; using System.Threading; -using System.Threading.Tasks; using System.Xml; +using Emby.Dlna.Didl; +using Emby.Dlna.Service; +using MediaBrowser.Common.Extensions; +using MediaBrowser.Controller.Configuration; +using MediaBrowser.Controller.Drawing; using MediaBrowser.Controller.Dto; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; +using MediaBrowser.Controller.Entities.Movies; +using MediaBrowser.Controller.Entities.TV; +using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.LiveTv; using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.Playlists; using MediaBrowser.Controller.TV; +using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Entities; using MediaBrowser.Model.Globalization; +using MediaBrowser.Model.Querying; using MediaBrowser.Model.Xml; -using MediaBrowser.Model.Extensions; -using MediaBrowser.Controller.LiveTv; +using Microsoft.Extensions.Logging; namespace Emby.Dlna.ContentDirectory { @@ -311,7 +306,7 @@ namespace Emby.Dlna.ContentDirectory var resXML = builder.ToString(); - return new [] + return new[] { new KeyValuePair("Result", resXML), new KeyValuePair("NumberReturned", provided.ToString(_usCulture)), @@ -1144,7 +1139,7 @@ namespace Emby.Dlna.ContentDirectory StartIndex = query.StartIndex, UserId = query.User.Id - }, new [] { parent }, query.DtoOptions); + }, new[] { parent }, query.DtoOptions); return ToResult(result); } diff --git a/Emby.Dlna/ContentDirectory/ServiceActionListBuilder.cs b/Emby.Dlna/ContentDirectory/ServiceActionListBuilder.cs index 7749a39af..e999314fa 100644 --- a/Emby.Dlna/ContentDirectory/ServiceActionListBuilder.cs +++ b/Emby.Dlna/ContentDirectory/ServiceActionListBuilder.cs @@ -1,5 +1,5 @@ -using Emby.Dlna.Common; using System.Collections.Generic; +using Emby.Dlna.Common; namespace Emby.Dlna.ContentDirectory { @@ -7,7 +7,7 @@ namespace Emby.Dlna.ContentDirectory { public IEnumerable GetActions() { - return new [] + return new[] { GetSearchCapabilitiesAction(), GetSortCapabilitiesAction(), diff --git a/Emby.Dlna/Didl/DidlBuilder.cs b/Emby.Dlna/Didl/DidlBuilder.cs index a8217c0d4..1e22a84f5 100644 --- a/Emby.Dlna/Didl/DidlBuilder.cs +++ b/Emby.Dlna/Didl/DidlBuilder.cs @@ -1,4 +1,11 @@ -using MediaBrowser.Model.Extensions; +using System; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml; +using Emby.Dlna.Configuration; +using Emby.Dlna.ContentDirectory; using MediaBrowser.Controller.Channels; using MediaBrowser.Controller.Drawing; using MediaBrowser.Controller.Entities; @@ -6,23 +13,15 @@ using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.Playlists; -using Emby.Dlna.ContentDirectory; using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Entities; -using Microsoft.Extensions.Logging; -using MediaBrowser.Model.Net; -using System; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml; -using MediaBrowser.Controller.MediaEncoding; -using Emby.Dlna.Configuration; +using MediaBrowser.Model.Extensions; using MediaBrowser.Model.Globalization; +using MediaBrowser.Model.Net; +using Microsoft.Extensions.Logging; namespace Emby.Dlna.Didl { diff --git a/Emby.Dlna/Didl/Filter.cs b/Emby.Dlna/Didl/Filter.cs index 2c9a1ea18..1249e525d 100644 --- a/Emby.Dlna/Didl/Filter.cs +++ b/Emby.Dlna/Didl/Filter.cs @@ -1,6 +1,5 @@ -using MediaBrowser.Model.Extensions; -using System; -using System.Collections.Generic; +using System; +using MediaBrowser.Model.Extensions; namespace Emby.Dlna.Didl { diff --git a/Emby.Dlna/Didl/StringWriterWithEncoding.cs b/Emby.Dlna/Didl/StringWriterWithEncoding.cs index b5c565801..23b5f017c 100644 --- a/Emby.Dlna/Didl/StringWriterWithEncoding.cs +++ b/Emby.Dlna/Didl/StringWriterWithEncoding.cs @@ -1,8 +1,6 @@ using System; -using System.Collections.Generic; using System.IO; using System.Text; -using System.Threading.Tasks; namespace Emby.Dlna.Didl { diff --git a/Emby.Dlna/DlnaManager.cs b/Emby.Dlna/DlnaManager.cs index a8777cbac..366a10cc3 100644 --- a/Emby.Dlna/DlnaManager.cs +++ b/Emby.Dlna/DlnaManager.cs @@ -1,24 +1,22 @@ -using MediaBrowser.Common.Configuration; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using Emby.Dlna.Profiles; +using Emby.Dlna.Server; +using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Extensions; using MediaBrowser.Controller; using MediaBrowser.Controller.Dlna; using MediaBrowser.Controller.Drawing; -using MediaBrowser.Controller.Plugins; -using Emby.Dlna.Profiles; -using Emby.Dlna.Server; using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Drawing; -using Microsoft.Extensions.Logging; -using MediaBrowser.Model.Serialization; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; using MediaBrowser.Model.IO; using MediaBrowser.Model.Reflection; -using MediaBrowser.Model.Extensions; +using MediaBrowser.Model.Serialization; +using Microsoft.Extensions.Logging; namespace Emby.Dlna { diff --git a/Emby.Dlna/Eventing/EventManager.cs b/Emby.Dlna/Eventing/EventManager.cs index ea9ba3f22..32bdec62f 100644 --- a/Emby.Dlna/Eventing/EventManager.cs +++ b/Emby.Dlna/Eventing/EventManager.cs @@ -1,14 +1,13 @@ -using MediaBrowser.Common.Extensions; -using MediaBrowser.Common.Net; -using MediaBrowser.Controller.Dlna; -using Microsoft.Extensions.Logging; -using System; +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; +using MediaBrowser.Common.Extensions; +using MediaBrowser.Common.Net; +using Microsoft.Extensions.Logging; namespace Emby.Dlna.Eventing { diff --git a/Emby.Dlna/Main/DlnaEntryPoint.cs b/Emby.Dlna/Main/DlnaEntryPoint.cs index eae3f22de..9c219ec0e 100644 --- a/Emby.Dlna/Main/DlnaEntryPoint.cs +++ b/Emby.Dlna/Main/DlnaEntryPoint.cs @@ -1,4 +1,10 @@ -using MediaBrowser.Common.Configuration; +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Emby.Dlna.PlayTo; +using Emby.Dlna.Ssdp; +using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Net; using MediaBrowser.Controller; @@ -6,25 +12,19 @@ using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Dlna; using MediaBrowser.Controller.Drawing; using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.Plugins; using MediaBrowser.Controller.Session; using MediaBrowser.Controller.TV; -using Emby.Dlna.PlayTo; -using Emby.Dlna.Ssdp; -using Microsoft.Extensions.Logging; -using System; -using System.Linq; -using System.Threading.Tasks; -using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Net; using MediaBrowser.Model.System; using MediaBrowser.Model.Threading; using MediaBrowser.Model.Xml; +using Microsoft.Extensions.Logging; using Rssdp; using Rssdp.Infrastructure; -using System.Threading; namespace Emby.Dlna.Main { @@ -282,7 +282,7 @@ namespace Emby.Dlna.Main SetProperies(device, fullService); _Publisher.AddDevice(device); - var embeddedDevices = new [] + var embeddedDevices = new[] { "urn:schemas-upnp-org:service:ContentDirectory:1", "urn:schemas-upnp-org:service:ConnectionManager:1", diff --git a/Emby.Dlna/MediaReceiverRegistrar/ControlHandler.cs b/Emby.Dlna/MediaReceiverRegistrar/ControlHandler.cs index 5ffa30f68..6257892b1 100644 --- a/Emby.Dlna/MediaReceiverRegistrar/ControlHandler.cs +++ b/Emby.Dlna/MediaReceiverRegistrar/ControlHandler.cs @@ -1,11 +1,10 @@ -using MediaBrowser.Common.Extensions; -using MediaBrowser.Controller.Configuration; -using Emby.Dlna.Server; -using Emby.Dlna.Service; -using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; +using Emby.Dlna.Service; +using MediaBrowser.Common.Extensions; +using MediaBrowser.Controller.Configuration; using MediaBrowser.Model.Xml; +using Microsoft.Extensions.Logging; namespace Emby.Dlna.MediaReceiverRegistrar { diff --git a/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrar.cs b/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrar.cs index f07af0464..929d29a27 100644 --- a/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrar.cs +++ b/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrar.cs @@ -1,11 +1,9 @@ -using MediaBrowser.Common.Net; -using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.Dlna; +using System.Collections.Generic; using Emby.Dlna.Service; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; +using MediaBrowser.Common.Net; +using MediaBrowser.Controller.Configuration; using MediaBrowser.Model.Xml; +using Microsoft.Extensions.Logging; namespace Emby.Dlna.MediaReceiverRegistrar { diff --git a/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarXmlBuilder.cs b/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarXmlBuilder.cs index efddbc670..641341185 100644 --- a/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarXmlBuilder.cs +++ b/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarXmlBuilder.cs @@ -1,6 +1,6 @@ +using System.Collections.Generic; using Emby.Dlna.Common; using Emby.Dlna.Service; -using System.Collections.Generic; namespace Emby.Dlna.MediaReceiverRegistrar { diff --git a/Emby.Dlna/MediaReceiverRegistrar/ServiceActionListBuilder.cs b/Emby.Dlna/MediaReceiverRegistrar/ServiceActionListBuilder.cs index a1f328411..86429f605 100644 --- a/Emby.Dlna/MediaReceiverRegistrar/ServiceActionListBuilder.cs +++ b/Emby.Dlna/MediaReceiverRegistrar/ServiceActionListBuilder.cs @@ -1,5 +1,5 @@ -using Emby.Dlna.Common; using System.Collections.Generic; +using Emby.Dlna.Common; namespace Emby.Dlna.MediaReceiverRegistrar { @@ -7,7 +7,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar { public IEnumerable GetActions() { - return new [] + return new[] { GetIsValidated(), GetIsAuthorized(), diff --git a/Emby.Dlna/PlayTo/CurrentIdEventArgs.cs b/Emby.Dlna/PlayTo/CurrentIdEventArgs.cs index 99aa50bd9..e148191f3 100644 --- a/Emby.Dlna/PlayTo/CurrentIdEventArgs.cs +++ b/Emby.Dlna/PlayTo/CurrentIdEventArgs.cs @@ -4,6 +4,6 @@ namespace Emby.Dlna.PlayTo { public class CurrentIdEventArgs : EventArgs { - public string Id { get; set; } + public string Id { get; set; } } } diff --git a/Emby.Dlna/PlayTo/Device.cs b/Emby.Dlna/PlayTo/Device.cs index cf53bb861..127c29c47 100644 --- a/Emby.Dlna/PlayTo/Device.cs +++ b/Emby.Dlna/PlayTo/Device.cs @@ -1,21 +1,17 @@ -using MediaBrowser.Common.Net; -using MediaBrowser.Controller.Configuration; -using Emby.Dlna.Common; -using Emby.Dlna.Ssdp; -using Microsoft.Extensions.Logging; -using MediaBrowser.Model.Net; -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; -using System.Net; -using System.Security; using System.Threading; using System.Threading.Tasks; using System.Xml.Linq; +using Emby.Dlna.Common; using Emby.Dlna.Server; +using Emby.Dlna.Ssdp; +using MediaBrowser.Common.Net; +using MediaBrowser.Controller.Configuration; using MediaBrowser.Model.Threading; -using MediaBrowser.Model.Extensions; +using Microsoft.Extensions.Logging; namespace Emby.Dlna.PlayTo { diff --git a/Emby.Dlna/PlayTo/DeviceInfo.cs b/Emby.Dlna/PlayTo/DeviceInfo.cs index d453a3d82..6642b3d7b 100644 --- a/Emby.Dlna/PlayTo/DeviceInfo.cs +++ b/Emby.Dlna/PlayTo/DeviceInfo.cs @@ -1,6 +1,6 @@ -using Emby.Dlna.Common; +using System.Collections.Generic; +using Emby.Dlna.Common; using MediaBrowser.Model.Dlna; -using System.Collections.Generic; namespace Emby.Dlna.PlayTo { diff --git a/Emby.Dlna/PlayTo/PlayToController.cs b/Emby.Dlna/PlayTo/PlayToController.cs index c7e45b896..85937963d 100644 --- a/Emby.Dlna/PlayTo/PlayToController.cs +++ b/Emby.Dlna/PlayTo/PlayToController.cs @@ -1,28 +1,25 @@ -using MediaBrowser.Controller.Dlna; -using MediaBrowser.Controller.Drawing; -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Library; -using MediaBrowser.Controller.Session; -using Emby.Dlna.Didl; -using MediaBrowser.Model.Dlna; -using MediaBrowser.Model.Dto; -using MediaBrowser.Model.Entities; -using Microsoft.Extensions.Logging; -using MediaBrowser.Model.Session; -using MediaBrowser.Model.System; -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Threading; using System.Threading.Tasks; +using Emby.Dlna.Didl; using MediaBrowser.Common.Configuration; +using MediaBrowser.Controller.Dlna; +using MediaBrowser.Controller.Drawing; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Library; using MediaBrowser.Controller.MediaEncoding; +using MediaBrowser.Controller.Session; +using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Entities; using MediaBrowser.Model.Events; using MediaBrowser.Model.Globalization; -using MediaBrowser.Model.Extensions; -using System.Net.Http; using MediaBrowser.Model.Services; +using MediaBrowser.Model.Session; +using Microsoft.Extensions.Logging; namespace Emby.Dlna.PlayTo { diff --git a/Emby.Dlna/PlayTo/PlayToManager.cs b/Emby.Dlna/PlayTo/PlayToManager.cs index 47d00aad5..177303d48 100644 --- a/Emby.Dlna/PlayTo/PlayToManager.cs +++ b/Emby.Dlna/PlayTo/PlayToManager.cs @@ -1,26 +1,23 @@ -using MediaBrowser.Common.Net; +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Common.Extensions; +using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Dlna; using MediaBrowser.Controller.Drawing; using MediaBrowser.Controller.Library; -using MediaBrowser.Controller.Session; -using Microsoft.Extensions.Logging; -using MediaBrowser.Model.Session; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Threading.Tasks; using MediaBrowser.Controller.MediaEncoding; +using MediaBrowser.Controller.Session; using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Events; using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Net; +using MediaBrowser.Model.Session; using MediaBrowser.Model.Threading; -using System.Threading; -using MediaBrowser.Common.Extensions; -using MediaBrowser.Controller.Devices; +using Microsoft.Extensions.Logging; namespace Emby.Dlna.PlayTo { diff --git a/Emby.Dlna/PlayTo/PlaylistItemFactory.cs b/Emby.Dlna/PlayTo/PlaylistItemFactory.cs index 1080320e0..aceb634e3 100644 --- a/Emby.Dlna/PlayTo/PlaylistItemFactory.cs +++ b/Emby.Dlna/PlayTo/PlaylistItemFactory.cs @@ -1,10 +1,9 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Dlna; -using MediaBrowser.Model.Session; -using System; using System.Globalization; using System.IO; using System.Linq; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Session; namespace Emby.Dlna.PlayTo { diff --git a/Emby.Dlna/PlayTo/SsdpHttpClient.cs b/Emby.Dlna/PlayTo/SsdpHttpClient.cs index 963577169..1ad99fac5 100644 --- a/Emby.Dlna/PlayTo/SsdpHttpClient.cs +++ b/Emby.Dlna/PlayTo/SsdpHttpClient.cs @@ -1,13 +1,13 @@ -using MediaBrowser.Common.Net; -using MediaBrowser.Controller.Configuration; -using Emby.Dlna.Common; using System; using System.Globalization; using System.IO; using System.Text; +using System.Threading; using System.Threading.Tasks; using System.Xml.Linq; -using System.Threading; +using Emby.Dlna.Common; +using MediaBrowser.Common.Net; +using MediaBrowser.Controller.Configuration; namespace Emby.Dlna.PlayTo { diff --git a/Emby.Dlna/PlayTo/TransportCommands.cs b/Emby.Dlna/PlayTo/TransportCommands.cs index e34ce8797..bb71c2835 100644 --- a/Emby.Dlna/PlayTo/TransportCommands.cs +++ b/Emby.Dlna/PlayTo/TransportCommands.cs @@ -1,8 +1,8 @@ using System; -using Emby.Dlna.Common; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; +using Emby.Dlna.Common; using Emby.Dlna.Ssdp; namespace Emby.Dlna.PlayTo diff --git a/Emby.Dlna/Profiles/DefaultProfile.cs b/Emby.Dlna/Profiles/DefaultProfile.cs index 1295c2f9a..9c85a8393 100644 --- a/Emby.Dlna/Profiles/DefaultProfile.cs +++ b/Emby.Dlna/Profiles/DefaultProfile.cs @@ -1,7 +1,5 @@ -using MediaBrowser.Model.Dlna; -using System.Linq; -using System.Xml.Serialization; -using MediaBrowser.Model.Extensions; +using System.Linq; +using MediaBrowser.Model.Dlna; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/DenonAvrProfile.cs b/Emby.Dlna/Profiles/DenonAvrProfile.cs index b8a44396a..b723accb2 100644 --- a/Emby.Dlna/Profiles/DenonAvrProfile.cs +++ b/Emby.Dlna/Profiles/DenonAvrProfile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/DirectTvProfile.cs b/Emby.Dlna/Profiles/DirectTvProfile.cs index 4243c1c9d..ec134905e 100644 --- a/Emby.Dlna/Profiles/DirectTvProfile.cs +++ b/Emby.Dlna/Profiles/DirectTvProfile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/DishHopperJoeyProfile.cs b/Emby.Dlna/Profiles/DishHopperJoeyProfile.cs index c1d1eede2..586a9d89a 100644 --- a/Emby.Dlna/Profiles/DishHopperJoeyProfile.cs +++ b/Emby.Dlna/Profiles/DishHopperJoeyProfile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/Foobar2000Profile.cs b/Emby.Dlna/Profiles/Foobar2000Profile.cs index 69a5d05dd..02be16f2a 100644 --- a/Emby.Dlna/Profiles/Foobar2000Profile.cs +++ b/Emby.Dlna/Profiles/Foobar2000Profile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/LgTvProfile.cs b/Emby.Dlna/Profiles/LgTvProfile.cs index 79cf2ebfd..ac9305336 100644 --- a/Emby.Dlna/Profiles/LgTvProfile.cs +++ b/Emby.Dlna/Profiles/LgTvProfile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/LinksysDMA2100Profile.cs b/Emby.Dlna/Profiles/LinksysDMA2100Profile.cs index ffb735d8d..480b0ae8e 100644 --- a/Emby.Dlna/Profiles/LinksysDMA2100Profile.cs +++ b/Emby.Dlna/Profiles/LinksysDMA2100Profile.cs @@ -1,5 +1,4 @@ -using System.Xml.Serialization; -using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Dlna; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/MarantzProfile.cs b/Emby.Dlna/Profiles/MarantzProfile.cs index b5b486a9c..0ad679a9e 100644 --- a/Emby.Dlna/Profiles/MarantzProfile.cs +++ b/Emby.Dlna/Profiles/MarantzProfile.cs @@ -1,5 +1,4 @@ -using System.Xml.Serialization; -using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Dlna; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/MediaMonkeyProfile.cs b/Emby.Dlna/Profiles/MediaMonkeyProfile.cs index 441933efa..e4053e878 100644 --- a/Emby.Dlna/Profiles/MediaMonkeyProfile.cs +++ b/Emby.Dlna/Profiles/MediaMonkeyProfile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { @@ -14,9 +13,9 @@ namespace Emby.Dlna.Profiles Identification = new DeviceIdentification { - FriendlyName = @"MediaMonkey", + FriendlyName = @"MediaMonkey", - Headers = new[] + Headers = new[] { new HttpHeaderInfo { diff --git a/Emby.Dlna/Profiles/PanasonicVieraProfile.cs b/Emby.Dlna/Profiles/PanasonicVieraProfile.cs index 53d6a62bb..5ca2252d6 100644 --- a/Emby.Dlna/Profiles/PanasonicVieraProfile.cs +++ b/Emby.Dlna/Profiles/PanasonicVieraProfile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/PopcornHourProfile.cs b/Emby.Dlna/Profiles/PopcornHourProfile.cs index b91089b1b..18467bace 100644 --- a/Emby.Dlna/Profiles/PopcornHourProfile.cs +++ b/Emby.Dlna/Profiles/PopcornHourProfile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/SamsungSmartTvProfile.cs b/Emby.Dlna/Profiles/SamsungSmartTvProfile.cs index b55146ffd..a0e02d685 100644 --- a/Emby.Dlna/Profiles/SamsungSmartTvProfile.cs +++ b/Emby.Dlna/Profiles/SamsungSmartTvProfile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/SharpSmartTvProfile.cs b/Emby.Dlna/Profiles/SharpSmartTvProfile.cs index d27a0e782..9cf678d65 100644 --- a/Emby.Dlna/Profiles/SharpSmartTvProfile.cs +++ b/Emby.Dlna/Profiles/SharpSmartTvProfile.cs @@ -1,5 +1,4 @@ -using System.Xml.Serialization; -using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Dlna; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs index dd2ca7a7d..26a76bd2b 100644 --- a/Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs +++ b/Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs index 69a2f2b61..ba6ec71f2 100644 --- a/Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs +++ b/Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs index ef443e56e..ddeb0f160 100644 --- a/Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs +++ b/Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs index 92e5cb086..10c3fbe38 100644 --- a/Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs +++ b/Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs b/Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs index 2bf65351e..0cbc9369c 100644 --- a/Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs +++ b/Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/SonyBravia2010Profile.cs b/Emby.Dlna/Profiles/SonyBravia2010Profile.cs index 7b452c536..7bfa5c70f 100644 --- a/Emby.Dlna/Profiles/SonyBravia2010Profile.cs +++ b/Emby.Dlna/Profiles/SonyBravia2010Profile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/SonyBravia2011Profile.cs b/Emby.Dlna/Profiles/SonyBravia2011Profile.cs index 75fefa9a8..90363c9b1 100644 --- a/Emby.Dlna/Profiles/SonyBravia2011Profile.cs +++ b/Emby.Dlna/Profiles/SonyBravia2011Profile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/SonyBravia2012Profile.cs b/Emby.Dlna/Profiles/SonyBravia2012Profile.cs index 1d55d91f9..64c1e0d49 100644 --- a/Emby.Dlna/Profiles/SonyBravia2012Profile.cs +++ b/Emby.Dlna/Profiles/SonyBravia2012Profile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/SonyBravia2013Profile.cs b/Emby.Dlna/Profiles/SonyBravia2013Profile.cs index 555ce419b..b45f561aa 100644 --- a/Emby.Dlna/Profiles/SonyBravia2013Profile.cs +++ b/Emby.Dlna/Profiles/SonyBravia2013Profile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/SonyBravia2014Profile.cs b/Emby.Dlna/Profiles/SonyBravia2014Profile.cs index b6e5bbea5..c0f8576f2 100644 --- a/Emby.Dlna/Profiles/SonyBravia2014Profile.cs +++ b/Emby.Dlna/Profiles/SonyBravia2014Profile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/SonyPs3Profile.cs b/Emby.Dlna/Profiles/SonyPs3Profile.cs index fc69d2dd3..735a783a4 100644 --- a/Emby.Dlna/Profiles/SonyPs3Profile.cs +++ b/Emby.Dlna/Profiles/SonyPs3Profile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/SonyPs4Profile.cs b/Emby.Dlna/Profiles/SonyPs4Profile.cs index 9b444ec24..a65d55754 100644 --- a/Emby.Dlna/Profiles/SonyPs4Profile.cs +++ b/Emby.Dlna/Profiles/SonyPs4Profile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Profiles/WdtvLiveProfile.cs b/Emby.Dlna/Profiles/WdtvLiveProfile.cs index bab557674..ed9e45bc7 100644 --- a/Emby.Dlna/Profiles/WdtvLiveProfile.cs +++ b/Emby.Dlna/Profiles/WdtvLiveProfile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { @@ -17,7 +16,7 @@ namespace Emby.Dlna.Profiles { ModelName = "WD TV", - Headers = new [] + Headers = new[] { new HttpHeaderInfo {Name = "User-Agent", Value = "alphanetworks", Match = HeaderMatchType.Substring}, new HttpHeaderInfo diff --git a/Emby.Dlna/Profiles/XboxOneProfile.cs b/Emby.Dlna/Profiles/XboxOneProfile.cs index 46740cb31..14f7b430c 100644 --- a/Emby.Dlna/Profiles/XboxOneProfile.cs +++ b/Emby.Dlna/Profiles/XboxOneProfile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using System.Xml.Serialization; namespace Emby.Dlna.Profiles { diff --git a/Emby.Dlna/Properties/AssemblyInfo.cs b/Emby.Dlna/Properties/AssemblyInfo.cs index fd3b43369..9d3a22c97 100644 --- a/Emby.Dlna/Properties/AssemblyInfo.cs +++ b/Emby.Dlna/Properties/AssemblyInfo.cs @@ -1,6 +1,5 @@ -using System.Resources; using System.Reflection; -using System.Runtime.InteropServices; +using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information diff --git a/Emby.Dlna/Server/DescriptionXmlBuilder.cs b/Emby.Dlna/Server/DescriptionXmlBuilder.cs index bd57f4c43..e0ecbee43 100644 --- a/Emby.Dlna/Server/DescriptionXmlBuilder.cs +++ b/Emby.Dlna/Server/DescriptionXmlBuilder.cs @@ -1,12 +1,11 @@ -using Emby.Dlna.Common; -using MediaBrowser.Model.Dlna; -using MediaBrowser.Model.Extensions; using System; using System.Collections.Generic; using System.Globalization; using System.Linq; -using System.Security; using System.Text; +using Emby.Dlna.Common; +using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Extensions; namespace Emby.Dlna.Server { diff --git a/Emby.Dlna/Service/BaseControlHandler.cs b/Emby.Dlna/Service/BaseControlHandler.cs index ae094cc2f..d3fc1d1f8 100644 --- a/Emby.Dlna/Service/BaseControlHandler.cs +++ b/Emby.Dlna/Service/BaseControlHandler.cs @@ -1,17 +1,14 @@ -using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.Dlna; -using Emby.Dlna.Server; -using Microsoft.Extensions.Logging; -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Xml; using Emby.Dlna.Didl; +using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Extensions; using MediaBrowser.Model.Xml; -using MediaBrowser.Model.Extensions; +using Microsoft.Extensions.Logging; namespace Emby.Dlna.Service { @@ -205,7 +202,7 @@ namespace Emby.Dlna.Service return result; } - private void ParseFirstBodyChild(XmlReader reader, IDictionary headers) + private void ParseFirstBodyChild(XmlReader reader, IDictionary headers) { reader.MoveToContent(); reader.Read(); @@ -229,7 +226,7 @@ namespace Emby.Dlna.Service { public string LocalName; public string NamespaceURI; - public IDictionary Headers = new Dictionary(StringComparer.OrdinalIgnoreCase); + public IDictionary Headers = new Dictionary(StringComparer.OrdinalIgnoreCase); } protected abstract IEnumerable> GetResult(string methodName, IDictionary methodParams); diff --git a/Emby.Dlna/Service/BaseService.cs b/Emby.Dlna/Service/BaseService.cs index 10ef12c6c..d7357a45c 100644 --- a/Emby.Dlna/Service/BaseService.cs +++ b/Emby.Dlna/Service/BaseService.cs @@ -1,6 +1,5 @@ -using MediaBrowser.Common.Net; -using MediaBrowser.Controller.Dlna; -using Emby.Dlna.Eventing; +using Emby.Dlna.Eventing; +using MediaBrowser.Common.Net; using Microsoft.Extensions.Logging; namespace Emby.Dlna.Service diff --git a/Emby.Dlna/Service/ControlErrorHandler.cs b/Emby.Dlna/Service/ControlErrorHandler.cs index 431dea932..96d65356c 100644 --- a/Emby.Dlna/Service/ControlErrorHandler.cs +++ b/Emby.Dlna/Service/ControlErrorHandler.cs @@ -1,5 +1,4 @@ -using MediaBrowser.Controller.Dlna; -using System; +using System; using System.IO; using System.Text; using System.Xml; diff --git a/Emby.Dlna/Service/ServiceXmlBuilder.cs b/Emby.Dlna/Service/ServiceXmlBuilder.cs index 68782ffb7..bd1f0bf05 100644 --- a/Emby.Dlna/Service/ServiceXmlBuilder.cs +++ b/Emby.Dlna/Service/ServiceXmlBuilder.cs @@ -1,7 +1,6 @@ -using Emby.Dlna.Common; using System.Collections.Generic; -using System.Security; using System.Text; +using Emby.Dlna.Common; using Emby.Dlna.Server; namespace Emby.Dlna.Service diff --git a/Emby.Dlna/Ssdp/DeviceDiscovery.cs b/Emby.Dlna/Ssdp/DeviceDiscovery.cs index e01ff8149..c06274fd4 100644 --- a/Emby.Dlna/Ssdp/DeviceDiscovery.cs +++ b/Emby.Dlna/Ssdp/DeviceDiscovery.cs @@ -1,19 +1,12 @@ -using MediaBrowser.Common.Events; -using MediaBrowser.Controller; -using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.Dlna; -using Microsoft.Extensions.Logging; -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Net; -using System.Threading; -using System.Threading.Tasks; -using MediaBrowser.Common.Net; +using MediaBrowser.Controller.Configuration; using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Events; using MediaBrowser.Model.Net; using MediaBrowser.Model.Threading; +using Microsoft.Extensions.Logging; using Rssdp; using Rssdp.Infrastructure; diff --git a/Emby.Dlna/Ssdp/Extensions.cs b/Emby.Dlna/Ssdp/Extensions.cs index 41a361515..134549456 100644 --- a/Emby.Dlna/Ssdp/Extensions.cs +++ b/Emby.Dlna/Ssdp/Extensions.cs @@ -1,7 +1,4 @@ -using System; -using System.Net; -using System.Threading.Tasks; -using System.Xml.Linq; +using System.Xml.Linq; namespace Emby.Dlna.Ssdp { -- cgit v1.2.3