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 9b22b77734..d42184f8ea 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 d42184f8ea..674bc4c8ee 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 aa4bb61279..45d4593de2 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 5630d7d3ce..4f5950ac73 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 dbc7b16a22..7397d4b60f 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 1a33154f87..fd78dfa8e7 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 a5fa24fc82..38fbac0309 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 602eeb29be..c8d6f20229 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 4c98a3388b..0222b3782c 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 32a8f6b457..1bbe30b955 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 c60757c02e..5db68bbf1c 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 2e423c31e0..ba7f7070b6 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 1f670b7528..d09ef3a15f 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 387540b812..4d1a4ed2f5 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 8d99f7b7f0..6aca093ecf 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 4fdba39fa3..5390f50495 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 0212d1d7ce..55b23b68c9 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 e01248fa5b..ecba7c0132 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 7d611dea86..1af7f0d515 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 9c1373f746..d864a8bb74 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 950d561b05..c96542dca4 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 194ae73e06..dd6607f9d4 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 e6a220a7f4..4da6b48500 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 571e17d060..92a943eed5 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 f19f0dfb5d..82b2e0ba2b 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 ab747d189b..e26d98d70e 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 db18025e65..f5873455a6 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 7e3e5f650a..a8c32fd99f 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 674bc4c8ee..b7727b5580 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 7c809a952a..217b8cfce6 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 2695a54332..15fdb36c4c 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 57d4078a58..97ae502459 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 7749a39af8..e999314fa6 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 a8217c0d41..1e22a84f5a 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 2c9a1ea184..1249e525dd 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 b5c565801f..23b5f017c8 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 a8777cbac5..366a10cc38 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 ea9ba3f22c..32bdec62fd 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 eae3f22de4..9c219ec0ed 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 5ffa30f685..6257892b19 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 f07af0464a..929d29a275 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 efddbc6705..6413411851 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 a1f3284111..86429f6051 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 99aa50bd91..e148191f39 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 cf53bb861e..127c29c471 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 d453a3d829..6642b3d7be 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 c7e45b8964..85937963da 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 47d00aad56..177303d484 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 1080320e0c..aceb634e33 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 963577169b..1ad99fac5b 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 e34ce87976..bb71c2835f 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 1295c2f9a8..9c85a83937 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 b8a44396a3..b723accb21 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 4243c1c9df..ec134905e7 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 c1d1eede25..586a9d89af 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 69a5d05ddd..02be16f2ac 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 79cf2ebfd9..ac93053366 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 ffb735d8db..480b0ae8e4 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 b5b486a9c9..0ad679a9ee 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 441933efad..e4053e878a 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 53d6a62bba..5ca2252d62 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 b91089b1bd..18467baced 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 b55146ffdf..a0e02d685f 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 d27a0e7824..9cf678d657 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 dd2ca7a7d0..26a76bd2bc 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 69a2f2b618..ba6ec71f28 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 ef443e56ed..ddeb0f160d 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 92e5cb086f..10c3fbe381 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 2bf65351e1..0cbc9369cd 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 7b452c536c..7bfa5c70f7 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 75fefa9a86..90363c9b1f 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 1d55d91f9e..64c1e0d497 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 555ce419b2..b45f561aa5 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 b6e5bbea51..c0f8576f2a 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 fc69d2dd34..735a783a46 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 9b444ec243..a65d55754f 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 bab5576745..ed9e45bc7a 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 46740cb311..14f7b430cb 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 fd3b433699..9d3a22c970 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 bd57f4c43f..e0ecbee43f 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 ae094cc2f6..d3fc1d1f83 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 10ef12c6c2..d7357a45c0 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 431dea9320..96d65356c8 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 68782ffb76..bd1f0bf05c 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 e01ff81497..c06274fd48 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 41a361515b..1345494566 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