The Free Software Media System - Server Backend & API
Reduce warnings in Emby.Dlna
Davidca2b36bdb05c
diff --git a/Emby.Dlna/ConfigurationExtension.cs b/Emby.Dlna/ConfigurationExtension.csindex dba9019677..3dcfe60d9d 100644--- a/Emby.Dlna/ConfigurationExtension.cs+++ b/Emby.Dlna/ConfigurationExtension.cs@@ -19,12 +19,12 @@ namespace Emby.Dlna{public IEnumerable<ConfigurationStore> GetConfigurations(){- return new ConfigurationStore[]+ return new[]{new ConfigurationStore{Key = "dlna",- ConfigurationType = typeof (DlnaOptions)+ ConfigurationType = typeof(DlnaOptions)}};}diff --git a/Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.cs b/Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.csindex b31d437c3b..c8db5a3674 100644--- a/Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.cs+++ b/Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.cs@@ -44,7 +44,7 @@ namespace Emby.Dlna.ConnectionManagerDataType = "string",SendsEvents = false,- AllowedValues = new string[]+ AllowedValues = new[]{"OK","ContentFormatMismatch",@@ -67,7 +67,7 @@ namespace Emby.Dlna.ConnectionManagerDataType = "string",SendsEvents = false,- AllowedValues = new string[]+ AllowedValues = new[]{"Output","Input"diff --git a/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs b/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.csindex 6db4d7cb66..743dcc5161 100644--- a/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs+++ b/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs@@ -10,7 +10,8 @@ namespace Emby.Dlna.ContentDirectory{public string GetXml(){- return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(),+ return new ServiceXmlBuilder().GetXml(+ new ServiceActionListBuilder().GetActions(),GetStateVariables());}@@ -101,7 +102,7 @@ namespace Emby.Dlna.ContentDirectoryDataType = "string",SendsEvents = false,- AllowedValues = new string[]+ AllowedValues = new[]{"BrowseMetadata","BrowseDirectChildren"diff --git a/Emby.Dlna/ContentDirectory/ControlHandler.cs b/Emby.Dlna/ContentDirectory/ControlHandler.csindex 00821bf780..72f2e7dd47 100644--- a/Emby.Dlna/ContentDirectory/ControlHandler.cs+++ b/Emby.Dlna/ContentDirectory/ControlHandler.cs@@ -253,7 +253,7 @@ namespace Emby.Dlna.ContentDirectoryvar id = sparams["ObjectID"];var flag = sparams["BrowseFlag"];var filter = new Filter(GetValueOrDefault(sparams, "Filter", "*"));- var sortCriteria = new SortCriteria(GetValueOrDefault(sparams, "SortCriteria", ""));+ var sortCriteria = new SortCriteria(GetValueOrDefault(sparams, "SortCriteria", string.Empty));var provided = 0;@@ -362,8 +362,8 @@ namespace Emby.Dlna.ContentDirectoryprivate void HandleSearch(XmlWriter xmlWriter, IDictionary<string, string> sparams, string deviceId){- var searchCriteria = new SearchCriteria(GetValueOrDefault(sparams, "SearchCriteria", ""));- var sortCriteria = new SortCriteria(GetValueOrDefault(sparams, "SortCriteria", ""));+ var searchCriteria = new SearchCriteria(GetValueOrDefault(sparams, "SearchCriteria", string.Empty));+ var sortCriteria = new SortCriteria(GetValueOrDefault(sparams, "SortCriteria", string.Empty));var filter = new Filter(GetValueOrDefault(sparams, "Filter", "*"));// sort example: dc:title, dc:datediff --git a/Emby.Dlna/ControlRequest.cs b/Emby.Dlna/ControlRequest.csindex a6e03b7e6a..c82e002ce5 100644--- a/Emby.Dlna/ControlRequest.cs+++ b/Emby.Dlna/ControlRequest.cs@@ -7,6 +7,11 @@ namespace Emby.Dlna{public class ControlRequest{+ public ControlRequest()+ {+ Headers = new HeaderDictionary();+ }+public IHeaderDictionary Headers { get; set; }public Stream InputXml { get; set; }@@ -14,10 +19,5 @@ namespace Emby.Dlnapublic string TargetServerUuId { get; set; }public string RequestedUrl { get; set; }-- public ControlRequest()- {- Headers = new HeaderDictionary();- }}}diff --git a/Emby.Dlna/Didl/DidlBuilder.cs b/Emby.Dlna/Didl/DidlBuilder.csindex 70e358019a..74007c92b7 100644--- a/Emby.Dlna/Didl/DidlBuilder.cs+++ b/Emby.Dlna/Didl/DidlBuilder.cs@@ -34,12 +34,12 @@ namespace Emby.Dlna.Didl{public class DidlBuilder{- private readonly CultureInfo _usCulture = new CultureInfo("en-US");+ private const string NsDidl = "urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/";+ private const string NsDc = "http://purl.org/dc/elements/1.1/";+ private const string NsUpnp = "urn:schemas-upnp-org:metadata-1-0/upnp/";+ private const string NsDlna = "urn:schemas-dlna-org:metadata-1-0/";- private const string NS_DIDL = "urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/";- private const string NS_DC = "http://purl.org/dc/elements/1.1/";- private const string NS_UPNP = "urn:schemas-upnp-org:metadata-1-0/upnp/";- private const string NS_DLNA = "urn:schemas-dlna-org:metadata-1-0/";+ private readonly CultureInfo _usCulture = new CultureInfo("en-US");private readonly DeviceProfile _profile;private readonly IImageProcessor _imageProcessor;@@ -100,11 +100,11 @@ namespace Emby.Dlna.Didl{// writer.WriteStartDocument();- writer.WriteStartElement(string.Empty, "DIDL-Lite", NS_DIDL);+ writer.WriteStartElement(string.Empty, "DIDL-Lite", NsDidl);- writer.WriteAttributeString("xmlns", "dc", null, NS_DC);- writer.WriteAttributeString("xmlns", "dlna", null, NS_DLNA);- writer.WriteAttributeString("xmlns", "upnp", null, NS_UPNP);+ writer.WriteAttributeString("xmlns", "dc", null, NsDc);+ writer.WriteAttributeString("xmlns", "dlna", null, NsDlna);+ writer.WriteAttributeString("xmlns", "upnp", null, NsUpnp);// didl.SetAttribute("xmlns:sec", NS_SEC);WriteXmlRootAttributes(_profile, writer);@@ -147,7 +147,7 @@ namespace Emby.Dlna.Didl{var clientId = GetClientId(item, null);- writer.WriteStartElement(string.Empty, "item", NS_DIDL);+ writer.WriteStartElement(string.Empty, "item", NsDidl);writer.WriteAttributeString("restricted", "1");writer.WriteAttributeString("id", clientId);@@ -207,7 +207,8 @@ namespace Emby.Dlna.Didlvar targetWidth = streamInfo.TargetWidth;var targetHeight = streamInfo.TargetHeight;- var contentFeatureList = new ContentFeatureBuilder(_profile).BuildVideoHeader(streamInfo.Container,+ var contentFeatureList = new ContentFeatureBuilder(_profile).BuildVideoHeader(+ streamInfo.Container,streamInfo.TargetVideoCodec.FirstOrDefault(),streamInfo.TargetAudioCodec.FirstOrDefault(),targetWidth,@@ -279,7 +280,7 @@ namespace Emby.Dlna.Didl}else if (string.Equals(subtitleMode, "smi", StringComparison.OrdinalIgnoreCase)){- writer.WriteStartElement(string.Empty, "res", NS_DIDL);+ writer.WriteStartElement(string.Empty, "res", NsDidl);writer.WriteAttributeString("protocolInfo", "http-get:*:smi/caption:*");@@ -288,7 +289,7 @@ namespace Emby.Dlna.Didl}else{- writer.WriteStartElement(string.Empty, "res", NS_DIDL);+ writer.WriteStartElement(string.Empty, "res", NsDidl);var protocolInfo = string.Format(CultureInfo.InvariantCulture,"http-get:*:text/{0}:*",@@ -304,7 +305,7 @@ namespace Emby.Dlna.Didlprivate void AddVideoResource(XmlWriter writer, Filter filter, string contentFeatures, StreamInfo streamInfo){- writer.WriteStartElement(string.Empty, "res", NS_DIDL);+ writer.WriteStartElement(string.Empty, "res", NsDidl);var url = NormalizeDlnaMediaUrl(streamInfo.ToUrl(_serverAddress, _accessToken));@@ -526,7 +527,7 @@ namespace Emby.Dlna.Didlprivate void AddAudioResource(XmlWriter writer, BaseItem audio, string deviceId, Filter filter, StreamInfo streamInfo = null){- writer.WriteStartElement(string.Empty, "res", NS_DIDL);+ writer.WriteStartElement(string.Empty, "res", NsDidl);if (streamInfo == null){@@ -583,7 +584,8 @@ namespace Emby.Dlna.Didlwriter.WriteAttributeString("bitrate", targetAudioBitrate.Value.ToString(_usCulture));}- var mediaProfile = _profile.GetAudioMediaProfile(streamInfo.Container,+ var mediaProfile = _profile.GetAudioMediaProfile(+ streamInfo.Container,streamInfo.TargetAudioCodec.FirstOrDefault(),targetChannels,targetAudioBitrate,@@ -596,7 +598,8 @@ namespace Emby.Dlna.Didl? MimeTypes.GetMimeType(filename): mediaProfile.MimeType;- var contentFeatures = new ContentFeatureBuilder(_profile).BuildAudioHeader(streamInfo.Container,+ var contentFeatures = new ContentFeatureBuilder(_profile).BuildAudioHeader(+ streamInfo.Container,streamInfo.TargetAudioCodec.FirstOrDefault(),targetAudioBitrate,targetSampleRate,@@ -627,7 +630,7 @@ namespace Emby.Dlna.Didlpublic void WriteFolderElement(XmlWriter writer, BaseItem folder, StubType? stubType, BaseItem context, int childCount, Filter filter, string requestedId = null){- writer.WriteStartElement(string.Empty, "container", NS_DIDL);+ writer.WriteStartElement(string.Empty, "container", NsDidl);writer.WriteAttributeString("restricted", "1");writer.WriteAttributeString("searchable", "1");@@ -714,7 +717,7 @@ namespace Emby.Dlna.Didl// MediaMonkey for example won't display content without a title// if (filter.Contains("dc:title")){- AddValue(writer, "dc", "title", GetDisplayName(item, itemStubType, context), NS_DC);+ AddValue(writer, "dc", "title", GetDisplayName(item, itemStubType, context), NsDc);}WriteObjectClass(writer, item, itemStubType);@@ -723,7 +726,7 @@ namespace Emby.Dlna.Didl{if (item.PremiereDate.HasValue){- AddValue(writer, "dc", "date", item.PremiereDate.Value.ToString("o", CultureInfo.InvariantCulture), NS_DC);+ AddValue(writer, "dc", "date", item.PremiereDate.Value.ToString("o", CultureInfo.InvariantCulture), NsDc);}}@@ -731,13 +734,13 @@ namespace Emby.Dlna.Didl{foreach (var genre in item.Genres){- AddValue(writer, "upnp", "genre", genre, NS_UPNP);+ AddValue(writer, "upnp", "genre", genre, NsUpnp);}}foreach (var studio in item.Studios){- AddValue(writer, "upnp", "publisher", studio, NS_UPNP);+ AddValue(writer, "upnp", "publisher", studio, NsUpnp);}if (!(item is Folder))@@ -748,28 +751,29 @@ namespace Emby.Dlna.Didlif (!string.IsNullOrWhiteSpace(desc)){- AddValue(writer, "dc", "description", desc, NS_DC);+ AddValue(writer, "dc", "description", desc, NsDc);}}+// if (filter.Contains("upnp:longDescription"))- //{+ // {// if (!string.IsNullOrWhiteSpace(item.Overview))// {- // AddValue(writer, "upnp", "longDescription", item.Overview, NS_UPNP);+ // AddValue(writer, "upnp", "longDescription", item.Overview, NsUpnp);// }- //}+ // }}if (!string.IsNullOrEmpty(item.OfficialRating)){if (filter.Contains("dc:rating")){- AddValue(writer, "dc", "rating", item.OfficialRating, NS_DC);+ AddValue(writer, "dc", "rating", item.OfficialRating, NsDc);}if (filter.Contains("upnp:rating")){- AddValue(writer, "upnp", "rating", item.OfficialRating, NS_UPNP);+ AddValue(writer, "upnp", "rating", item.OfficialRating, NsUpnp);}}@@ -781,7 +785,7 @@ namespace Emby.Dlna.Didl// More types here// http://oss.linn.co.uk/repos/Public/LibUpnpCil/DidlLite/UpnpAv/Test/TestDidlLite.cs- writer.WriteStartElement("upnp", "class", NS_UPNP);+ writer.WriteStartElement("upnp", "class", NsUpnp);if (item.IsDisplayedAsFolder || stubType.HasValue){@@ -882,7 +886,7 @@ namespace Emby.Dlna.Didlvar type = types.FirstOrDefault(i => string.Equals(i, actor.Type, StringComparison.OrdinalIgnoreCase) || string.Equals(i, actor.Role, StringComparison.OrdinalIgnoreCase))?? PersonType.Actor;- AddValue(writer, "upnp", type.ToLowerInvariant(), actor.Name, NS_UPNP);+ AddValue(writer, "upnp", type.ToLowerInvariant(), actor.Name, NsUpnp);}}@@ -896,8 +900,8 @@ namespace Emby.Dlna.Didl{foreach (var artist in hasArtists.Artists){- AddValue(writer, "upnp", "artist", artist, NS_UPNP);- AddValue(writer, "dc", "creator", artist, NS_DC);+ AddValue(writer, "upnp", "artist", artist, NsUpnp);+ AddValue(writer, "dc", "creator", artist, NsDc);// If it doesn't support album artists (musicvideo), then tag as bothif (hasAlbumArtists == null)@@ -917,16 +921,16 @@ namespace Emby.Dlna.Didlif (!string.IsNullOrWhiteSpace(item.Album)){- AddValue(writer, "upnp", "album", item.Album, NS_UPNP);+ AddValue(writer, "upnp", "album", item.Album, NsUpnp);}if (item.IndexNumber.HasValue){- AddValue(writer, "upnp", "originalTrackNumber", item.IndexNumber.Value.ToString(_usCulture), NS_UPNP);+ AddValue(writer, "upnp", "originalTrackNumber", item.IndexNumber.Value.ToString(_usCulture), NsUpnp);if (item is Episode){- AddValue(writer, "upnp", "episodeNumber", item.IndexNumber.Value.ToString(_usCulture), NS_UPNP);+ AddValue(writer, "upnp", "episodeNumber", item.IndexNumber.Value.ToString(_usCulture), NsUpnp);}}}@@ -935,7 +939,7 @@ namespace Emby.Dlna.Didl{try{- writer.WriteStartElement("upnp", "artist", NS_UPNP);+ writer.WriteStartElement("upnp", "artist", NsUpnp);writer.WriteAttributeString("role", "AlbumArtist");writer.WriteString(name);@@ -971,14 +975,14 @@ namespace Emby.Dlna.Didlvar albumartUrlInfo = GetImageUrl(imageInfo, _profile.MaxAlbumArtWidth, _profile.MaxAlbumArtHeight, "jpg");- writer.WriteStartElement("upnp", "albumArtURI", NS_UPNP);- writer.WriteAttributeString("dlna", "profileID", NS_DLNA, _profile.AlbumArtPn);+ writer.WriteStartElement("upnp", "albumArtURI", NsUpnp);+ writer.WriteAttributeString("dlna", "profileID", NsDlna, _profile.AlbumArtPn);writer.WriteString(albumartUrlInfo.Url);writer.WriteFullEndElement();// TOOD: Remove these default valuesvar iconUrlInfo = GetImageUrl(imageInfo, _profile.MaxIconWidth ?? 48, _profile.MaxIconHeight ?? 48, "jpg");- writer.WriteElementString("upnp", "icon", NS_UPNP, iconUrlInfo.Url);+ writer.WriteElementString("upnp", "icon", NsUpnp, iconUrlInfo.Url);if (!_profile.EnableAlbumArtInDidl){@@ -1021,7 +1025,7 @@ namespace Emby.Dlna.Didlvar albumartUrlInfo = GetImageUrl(imageInfo, maxWidth, maxHeight, format);- writer.WriteStartElement(string.Empty, "res", NS_DIDL);+ writer.WriteStartElement(string.Empty, "res", NsDidl);// Images must have a reported size or many clients (Bubble upnp), will only use the first thumbnail// rather than using a larger one when available@@ -1150,16 +1154,16 @@ namespace Emby.Dlna.Didl}// try- //{+ // {// var size = _imageProcessor.GetImageSize(imageInfo);// width = size.Width;// height = size.Height;- //}+ // }// catch- //{+ // {- //}+ // }var inputFormat = (Path.GetExtension(imageInfo.Path) ?? string.Empty).TrimStart('.')diff --git a/Emby.Dlna/Didl/StringWriterWithEncoding.cs b/Emby.Dlna/Didl/StringWriterWithEncoding.csindex 896fe992bf..d5276321f2 100644--- a/Emby.Dlna/Didl/StringWriterWithEncoding.cs+++ b/Emby.Dlna/Didl/StringWriterWithEncoding.cs@@ -1,6 +1,7 @@#pragma warning disable CS1591using System;+using System.Globalization;using System.IO;using System.Text;@@ -20,7 +21,7 @@ namespace Emby.Dlna.Didl}public StringWriterWithEncoding(StringBuilder sb)- : base(sb)+ : base(sb, CultureInfo.InvariantCulture){}@@ -29,7 +30,6 @@ namespace Emby.Dlna.Didl{}-public StringWriterWithEncoding(Encoding encoding){_encoding = encoding;@@ -42,7 +42,7 @@ namespace Emby.Dlna.Didl}public StringWriterWithEncoding(StringBuilder sb, Encoding encoding)- : base(sb)+ : base(sb, CultureInfo.InvariantCulture){_encoding = encoding;}diff --git a/Emby.Dlna/DlnaManager.cs b/Emby.Dlna/DlnaManager.csindex ce4be7b514..a6a4740d7a 100644--- a/Emby.Dlna/DlnaManager.cs+++ b/Emby.Dlna/DlnaManager.cs@@ -541,6 +541,7 @@ namespace Emby.Dlna};}}+/*class DlnaProfileEntryPoint : IServerEntryPoint{diff --git a/Emby.Dlna/Eventing/EventManager.cs b/Emby.Dlna/Eventing/EventManager.csindex 7d02f5e960..cc8e0ae06b 100644--- a/Emby.Dlna/Eventing/EventManager.cs+++ b/Emby.Dlna/Eventing/EventManager.cs@@ -22,6 +22,8 @@ namespace Emby.Dlna.Eventingprivate readonly ILogger _logger;private readonly IHttpClient _httpClient;+ private readonly CultureInfo _usCulture = new CultureInfo("en-US");+public EventManager(ILogger logger, IHttpClient httpClient){_httpClient = httpClient;@@ -58,7 +60,8 @@ namespace Emby.Dlna.Eventingvar timeout = ParseTimeout(requestedTimeoutString) ?? 300;var id = "uuid:" + Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);- _logger.LogDebug("Creating event subscription for {0} with timeout of {1} to {2}",+ _logger.LogDebug(+ "Creating event subscription for {0} with timeout of {1} to {2}",notificationType,timeout,callbackUrl);@@ -94,7 +97,7 @@ namespace Emby.Dlna.Eventing{_logger.LogDebug("Cancelling event subscription {0}", subscriptionId);- _subscriptions.TryRemove(subscriptionId, out EventSubscription sub);+ _subscriptions.TryRemove(subscriptionId, out _);return new EventSubscriptionResponse{@@ -103,7 +106,6 @@ namespace Emby.Dlna.Eventing};}- private readonly CultureInfo _usCulture = new CultureInfo("en-US");private EventSubscriptionResponse GetEventSubscriptionResponse(string subscriptionId, string requestedTimeoutString, int timeoutSeconds){var response = new EventSubscriptionResponsediff --git a/Emby.Dlna/Main/DlnaEntryPoint.cs b/Emby.Dlna/Main/DlnaEntryPoint.csindex a21d4cc11d..09932b747c 100644--- a/Emby.Dlna/Main/DlnaEntryPoint.cs+++ b/Emby.Dlna/Main/DlnaEntryPoint.cs@@ -32,6 +32,8 @@ namespace Emby.Dlna.Main{public class DlnaEntryPoint : IServerEntryPoint, IRunBeforeStartup{+ public static DlnaEntryPoint Current;+private readonly IServerConfigurationManager _config;private readonly ILogger<DlnaEntryPoint> _logger;private readonly IServerApplicationHost _appHost;@@ -54,13 +56,7 @@ namespace Emby.Dlna.Mainprivate SsdpDevicePublisher _publisher;private ISsdpCommunicationsServer _communicationsServer;- public IContentDirectory ContentDirectory { get; private set; }-- public IConnectionManager ConnectionManager { get; private set; }-- public IMediaReceiverRegistrar MediaReceiverRegistrar { get; private set; }-- public static DlnaEntryPoint Current;+ private bool _disposed;public DlnaEntryPoint(IServerConfigurationManager config,@@ -127,6 +123,12 @@ namespace Emby.Dlna.MainCurrent = this;}+ public IContentDirectory ContentDirectory { get; private set; }++ public IConnectionManager ConnectionManager { get; private set; }++ public IMediaReceiverRegistrar MediaReceiverRegistrar { get; private set; }+public async Task RunAsync(){await ((DlnaManager)_dlnaManager).InitProfilesAsync().ConfigureAwait(false);@@ -399,11 +401,36 @@ namespace Emby.Dlna.Main}}+ public void DisposeDevicePublisher()+ {+ if (_publisher != null)+ {+ _logger.LogInformation("Disposing SsdpDevicePublisher");+ _publisher.Dispose();+ _publisher = null;+ }+ }++ /// <inheritdoc />public void Dispose(){- DisposeDevicePublisher();- DisposePlayToManager();- DisposeDeviceDiscovery();+ Dispose(true);+ GC.SuppressFinalize(this);+ }++ protected virtual void Dispose(bool disposing)+ {+ if (_disposed)+ {+ return;+ }++ if (disposing)+ {+ DisposeDevicePublisher();+ DisposePlayToManager();+ DisposeDeviceDiscovery();+ }if (_communicationsServer != null){@@ -416,16 +443,8 @@ namespace Emby.Dlna.MainConnectionManager = null;MediaReceiverRegistrar = null;Current = null;- }- public void DisposeDevicePublisher()- {- if (_publisher != null)- {- _logger.LogInformation("Disposing SsdpDevicePublisher");- _publisher.Dispose();- _publisher = null;- }+ _disposed = true;}}}diff --git a/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarXmlBuilder.cs b/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarXmlBuilder.csindex 8497025461..26994925d1 100644--- a/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarXmlBuilder.cs+++ b/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarXmlBuilder.cs@@ -10,7 +10,8 @@ namespace Emby.Dlna.MediaReceiverRegistrar{public string GetXml(){- return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(),+ return new ServiceXmlBuilder().GetXml(+ new ServiceActionListBuilder().GetActions(),GetStateVariables());}diff --git a/Emby.Dlna/PlayTo/Device.cs b/Emby.Dlna/PlayTo/Device.csindex 86dd52a1b6..2708f20c3d 100644--- a/Emby.Dlna/PlayTo/Device.cs+++ b/Emby.Dlna/PlayTo/Device.cs@@ -45,13 +45,13 @@ namespace Emby.Dlna.PlayTopublic TimeSpan Position { get; set; } = TimeSpan.FromSeconds(0);- public TRANSPORTSTATE TransportState { get; private set; }+ public TransportState TransportState { get; private set; }- public bool IsPlaying => TransportState == TRANSPORTSTATE.PLAYING;+ public bool IsPlaying => TransportState == TransportState.Playing;- public bool IsPaused => TransportState == TRANSPORTSTATE.PAUSED || TransportState == TRANSPORTSTATE.PAUSED_PLAYBACK;+ public bool IsPaused => TransportState == TransportState.Paused || TransportState == TransportState.PausedPlayback;- public bool IsStopped => TransportState == TRANSPORTSTATE.STOPPED;+ public bool IsStopped => TransportState == TransportState.Stopped;private readonly IHttpClient _httpClient;@@ -400,7 +400,7 @@ namespace Emby.Dlna.PlayToawait new SsdpHttpClient(_httpClient).SendCommandAsync(Properties.BaseUrl, service, command.Name, avCommands.BuildPost(command, service.ServiceType, 1)).ConfigureAwait(false);- TransportState = TRANSPORTSTATE.PAUSED;+ TransportState = TransportState.Paused;RestartTimer(true);}@@ -435,7 +435,7 @@ namespace Emby.Dlna.PlayToif (transportState.HasValue){// If we're not playing anything no need to get additional data- if (transportState.Value == TRANSPORTSTATE.STOPPED)+ if (transportState.Value == TransportState.Stopped){UpdateMediaInfo(null, transportState.Value);}@@ -464,7 +464,7 @@ namespace Emby.Dlna.PlayTo}// If we're not playing anything make sure we don't get data more often than neccessry to keep the Session alive- if (transportState.Value == TRANSPORTSTATE.STOPPED)+ if (transportState.Value == TransportState.Stopped){RestartTimerInactive();}@@ -595,7 +595,7 @@ namespace Emby.Dlna.PlayToIsMuted = string.Equals(valueNode?.Value, "1", StringComparison.OrdinalIgnoreCase);}- private async Task<TRANSPORTSTATE?> GetTransportInfo(TransportCommands avCommands, CancellationToken cancellationToken)+ private async Task<TransportState?> GetTransportInfo(TransportCommands avCommands, CancellationToken cancellationToken){var command = avCommands.ServiceActions.FirstOrDefault(c => c.Name == "GetTransportInfo");if (command == null)@@ -627,7 +627,7 @@ namespace Emby.Dlna.PlayTovar transportStateValue = transportState?.Value;if (transportStateValue != null- && Enum.TryParse(transportStateValue, true, out TRANSPORTSTATE state))+ && Enum.TryParse(transportStateValue, true, out TransportState state)){return state;}@@ -1121,7 +1121,7 @@ namespace Emby.Dlna.PlayTopublic uBaseObject CurrentMediaInfo { get; private set; }- private void UpdateMediaInfo(uBaseObject mediaInfo, TRANSPORTSTATE state)+ private void UpdateMediaInfo(uBaseObject mediaInfo, TransportState state){TransportState = state;@@ -1130,7 +1130,7 @@ namespace Emby.Dlna.PlayToif (previousMediaInfo == null && mediaInfo != null){- if (state != TRANSPORTSTATE.STOPPED)+ if (state != TransportState.Stopped){OnPlaybackStart(mediaInfo);}diff --git a/Emby.Dlna/PlayTo/DeviceInfo.cs b/Emby.Dlna/PlayTo/DeviceInfo.csindex f3aaaebc4a..d3daab9e0a 100644--- a/Emby.Dlna/PlayTo/DeviceInfo.cs+++ b/Emby.Dlna/PlayTo/DeviceInfo.cs@@ -8,6 +8,9 @@ namespace Emby.Dlna.PlayTo{public class DeviceInfo{+ private readonly List<DeviceService> _services = new List<DeviceService>();+ private string _baseUrl = string.Empty;+public DeviceInfo(){Name = "Generic Device";@@ -33,7 +36,6 @@ namespace Emby.Dlna.PlayTopublic string PresentationUrl { get; set; }- private string _baseUrl = string.Empty;public string BaseUrl{get => _baseUrl;@@ -42,7 +44,6 @@ namespace Emby.Dlna.PlayTopublic DeviceIcon Icon { get; set; }- private readonly List<DeviceService> _services = new List<DeviceService>();public List<DeviceService> Services => _services;public DeviceIdentification ToDeviceIdentification()diff --git a/Emby.Dlna/PlayTo/MediaChangedEventArgs.cs b/Emby.Dlna/PlayTo/MediaChangedEventArgs.csnew file mode 100644index 0000000000..a8043d4ead--- /dev/null+++ b/Emby.Dlna/PlayTo/MediaChangedEventArgs.cs@@ -0,0 +1,13 @@+#pragma warning disable CS1591++using System;++namespace Emby.Dlna.PlayTo+{+ public class MediaChangedEventArgs : EventArgs+ {+ public uBaseObject OldMediaInfo { get; set; }++ public uBaseObject NewMediaInfo { get; set; }+ }+}diff --git a/Emby.Dlna/PlayTo/PlayToController.cs b/Emby.Dlna/PlayTo/PlayToController.csindex 92a93d4349..5182fa5098 100644--- a/Emby.Dlna/PlayTo/PlayToController.cs+++ b/Emby.Dlna/PlayTo/PlayToController.cs@@ -31,7 +31,6 @@ namespace Emby.Dlna.PlayTo{private static readonly CultureInfo _usCulture = CultureInfo.ReadOnly(new CultureInfo("en-US"));- private Device _device;private readonly SessionInfo _session;private readonly ISessionManager _sessionManager;private readonly ILibraryManager _libraryManager;@@ -50,6 +49,7 @@ namespace Emby.Dlna.PlayToprivate readonly string _accessToken;private readonly List<PlaylistItem> _playlist = new List<PlaylistItem>();+ private Device _device;private int _currentPlaylistIndex;private bool _disposed;@@ -372,8 +372,12 @@ namespace Emby.Dlna.PlayToif (!command.ControllingUserId.Equals(Guid.Empty)){- _sessionManager.LogSessionActivity(_session.Client, _session.ApplicationVersion, _session.DeviceId,- _session.DeviceName, _session.RemoteEndPoint, user);+ _sessionManager.LogSessionActivity(+ _session.Client,+ _session.ApplicationVersion,+ _session.DeviceId,+ _session.DeviceName,+ _session.RemoteEndPoint, user);}return PlayItems(playlist, cancellationToken);@@ -778,7 +782,7 @@ namespace Emby.Dlna.PlayToconst int maxWait = 15000000;const int interval = 500;var currentWait = 0;- while (_device.TransportState != TRANSPORTSTATE.PLAYING && currentWait < maxWait)+ while (_device.TransportState != TransportState.Playing && currentWait < maxWait){await Task.Delay(interval).ConfigureAwait(false);currentWait += interval;@@ -789,6 +793,9 @@ namespace Emby.Dlna.PlayToprivate class StreamParams{+ private MediaSourceInfo mediaSource;+ private IMediaSourceManager _mediaSourceManager;+public Guid ItemId { get; set; }public bool IsDirectStream { get; set; }@@ -809,15 +816,11 @@ namespace Emby.Dlna.PlayTopublic BaseItem Item { get; set; }- private MediaSourceInfo MediaSource;-- private IMediaSourceManager _mediaSourceManager;-public async Task<MediaSourceInfo> GetMediaSource(CancellationToken cancellationToken){- if (MediaSource != null)+ if (mediaSource != null){- return MediaSource;+ return mediaSource;}var hasMediaSources = Item as IHasMediaSources;@@ -827,9 +830,9 @@ namespace Emby.Dlna.PlayToreturn null;}- MediaSource = await _mediaSourceManager.GetMediaSource(Item, MediaSourceId, LiveStreamId, false, cancellationToken).ConfigureAwait(false);+ mediaSource = await _mediaSourceManager.GetMediaSource(Item, MediaSourceId, LiveStreamId, false, cancellationToken).ConfigureAwait(false);- return MediaSource;+ return mediaSource;}private static Guid GetItemId(string url)diff --git a/Emby.Dlna/PlayTo/PlayToManager.cs b/Emby.Dlna/PlayTo/PlayToManager.csindex 512589e4d7..ff28ce3e05 100644--- a/Emby.Dlna/PlayTo/PlayToManager.cs+++ b/Emby.Dlna/PlayTo/PlayToManager.cs@@ -92,7 +92,7 @@ namespace Emby.Dlna.PlayTo// It has to report that it's a media rendererif (usn.IndexOf("MediaRenderer:", StringComparison.OrdinalIgnoreCase) == -1 &&- nt.IndexOf("MediaRenderer:", StringComparison.OrdinalIgnoreCase) == -1)+ nt.IndexOf("MediaRenderer:", StringComparison.OrdinalIgnoreCase) == -1){// _logger.LogDebug("Upnp device {0} does not contain a MediaRenderer device (0).", location);return;@@ -192,20 +192,20 @@ namespace Emby.Dlna.PlayTocontroller = new PlayToController(sessionInfo,- _sessionManager,- _libraryManager,- _logger,- _dlnaManager,- _userManager,- _imageProcessor,- serverAddress,- null,- _deviceDiscovery,- _userDataManager,- _localization,- _mediaSourceManager,- _config,- _mediaEncoder);+ _sessionManager,+ _libraryManager,+ _logger,+ _dlnaManager,+ _userManager,+ _imageProcessor,+ serverAddress,+ null,+ _deviceDiscovery,+ _userDataManager,+ _localization,+ _mediaSourceManager,+ _config,+ _mediaEncoder);sessionInfo.AddController(controller);@@ -218,17 +218,17 @@ namespace Emby.Dlna.PlayTo{PlayableMediaTypes = profile.GetSupportedMediaTypes(),- SupportedCommands = new string[]+ SupportedCommands = new[]{- GeneralCommandType.VolumeDown.ToString(),- GeneralCommandType.VolumeUp.ToString(),- GeneralCommandType.Mute.ToString(),- GeneralCommandType.Unmute.ToString(),- GeneralCommandType.ToggleMute.ToString(),- GeneralCommandType.SetVolume.ToString(),- GeneralCommandType.SetAudioStreamIndex.ToString(),- GeneralCommandType.SetSubtitleStreamIndex.ToString(),- GeneralCommandType.PlayMediaSource.ToString()+ GeneralCommandType.VolumeDown.ToString(),+ GeneralCommandType.VolumeUp.ToString(),+ GeneralCommandType.Mute.ToString(),+ GeneralCommandType.Unmute.ToString(),+ GeneralCommandType.ToggleMute.ToString(),+ GeneralCommandType.SetVolume.ToString(),+ GeneralCommandType.SetAudioStreamIndex.ToString(),+ GeneralCommandType.SetSubtitleStreamIndex.ToString(),+ GeneralCommandType.PlayMediaSource.ToString()},SupportsMediaControl = true@@ -247,8 +247,9 @@ namespace Emby.Dlna.PlayTo{_disposeCancellationTokenSource.Cancel();}- catch+ catch (Exception ex){+ _logger.LogDebug("Error while disposing PlayToManager", ex);}_sessionLock.Dispose();diff --git a/Emby.Dlna/PlayTo/PlaybackStoppedEventArgs.cs b/Emby.Dlna/PlayTo/PlaybackStoppedEventArgs.csindex fa42b80e8b..5944d936cd 100644--- a/Emby.Dlna/PlayTo/PlaybackStoppedEventArgs.cs+++ b/Emby.Dlna/PlayTo/PlaybackStoppedEventArgs.cs@@ -8,11 +8,4 @@ namespace Emby.Dlna.PlayTo{public uBaseObject MediaInfo { get; set; }}-- public class MediaChangedEventArgs : EventArgs- {- public uBaseObject OldMediaInfo { get; set; }-- public uBaseObject NewMediaInfo { get; set; }- }}diff --git a/Emby.Dlna/PlayTo/TRANSPORTSTATE.cs b/Emby.Dlna/PlayTo/TRANSPORTSTATE.csdeleted file mode 100644index 7daefeca86..0000000000--- a/Emby.Dlna/PlayTo/TRANSPORTSTATE.cs+++ /dev/null@@ -1,13 +0,0 @@-#pragma warning disable CS1591--namespace Emby.Dlna.PlayTo-{- public enum TRANSPORTSTATE- {- STOPPED,- PLAYING,- TRANSITIONING,- PAUSED_PLAYBACK,- PAUSED- }-}diff --git a/Emby.Dlna/PlayTo/TransportState.cs b/Emby.Dlna/PlayTo/TransportState.csnew file mode 100644index 0000000000..2058e9dc79--- /dev/null+++ b/Emby.Dlna/PlayTo/TransportState.cs@@ -0,0 +1,13 @@+#pragma warning disable CS1591++namespace Emby.Dlna.PlayTo+{+ public enum TransportState+ {+ Stopped,+ Playing,+ Transitioning,+ PausedPlayback,+ Paused+ }+}diff --git a/Emby.Dlna/PlayTo/uBaseObject.cs b/Emby.Dlna/PlayTo/uBaseObject.csindex 05c19299f1..3301ad3e0a 100644--- a/Emby.Dlna/PlayTo/uBaseObject.cs+++ b/Emby.Dlna/PlayTo/uBaseObject.cs@@ -24,16 +24,6 @@ namespace Emby.Dlna.PlayTopublic string UpnpClass { get; set; }- public bool Equals(uBaseObject obj)- {- if (obj == null)- {- throw new ArgumentNullException(nameof(obj));- }-- return string.Equals(Id, obj.Id);- }-public string MediaType{get@@ -58,5 +48,15 @@ namespace Emby.Dlna.PlayToreturn null;}}++ public bool Equals(uBaseObject obj)+ {+ if (obj == null)+ {+ throw new ArgumentNullException(nameof(obj));+ }++ return string.Equals(Id, obj.Id, StringComparison.InvariantCulture);+ }}}diff --git a/Emby.Dlna/Profiles/DefaultProfile.cs b/Emby.Dlna/Profiles/DefaultProfile.csindex 90a23a4a22..d4af72b626 100644--- a/Emby.Dlna/Profiles/DefaultProfile.cs+++ b/Emby.Dlna/Profiles/DefaultProfile.cs@@ -64,14 +64,14 @@ namespace Emby.Dlna.Profilesnew DirectPlayProfile{// play all- Container = "",+ Container = string.Empty,Type = DlnaProfileType.Video},new DirectPlayProfile{// play all- Container = "",+ Container = string.Empty,Type = DlnaProfileType.Audio}};diff --git a/Emby.Dlna/Profiles/DishHopperJoeyProfile.cs b/Emby.Dlna/Profiles/DishHopperJoeyProfile.csindex 942e369309..2a7524a6a2 100644--- a/Emby.Dlna/Profiles/DishHopperJoeyProfile.cs+++ b/Emby.Dlna/Profiles/DishHopperJoeyProfile.cs@@ -24,7 +24,7 @@ namespace Emby.Dlna.Profiles{Match = HeaderMatchType.Substring,Name = "User-Agent",- Value ="Zip_"+ Value = "Zip_"}}};@@ -81,7 +81,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.Video,Codec = "h264",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -124,7 +124,7 @@ namespace Emby.Dlna.Profilesnew CodecProfile{Type = CodecType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -161,7 +161,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.VideoAudio,Codec = "ac3,he-aac",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -177,7 +177,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.VideoAudio,Codec = "aac",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -192,7 +192,7 @@ namespace Emby.Dlna.Profilesnew CodecProfile{Type = CodecType.VideoAudio,- Conditions = new []+ Conditions = new[]{// The device does not have any audio switching capabilitiesnew ProfileConditiondiff --git a/Emby.Dlna/Profiles/LgTvProfile.cs b/Emby.Dlna/Profiles/LgTvProfile.csindex 02301764c0..fbb368d3e3 100644--- a/Emby.Dlna/Profiles/LgTvProfile.cs+++ b/Emby.Dlna/Profiles/LgTvProfile.cs@@ -84,7 +84,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -191,7 +191,7 @@ namespace Emby.Dlna.Profiles}};- ResponseProfiles = new ResponseProfile[]+ ResponseProfiles = new[]{new ResponseProfile{diff --git a/Emby.Dlna/Profiles/LinksysDMA2100Profile.cs b/Emby.Dlna/Profiles/LinksysDMA2100Profile.csindex 1b1423520c..1a510dfecf 100644--- a/Emby.Dlna/Profiles/LinksysDMA2100Profile.cs+++ b/Emby.Dlna/Profiles/LinksysDMA2100Profile.cs@@ -32,7 +32,7 @@ namespace Emby.Dlna.Profiles}};- ResponseProfiles = new ResponseProfile[]+ ResponseProfiles = new[]{new ResponseProfile{diff --git a/Emby.Dlna/Profiles/PanasonicVieraProfile.cs b/Emby.Dlna/Profiles/PanasonicVieraProfile.csindex 44c35e1425..0d536acf39 100644--- a/Emby.Dlna/Profiles/PanasonicVieraProfile.cs+++ b/Emby.Dlna/Profiles/PanasonicVieraProfile.cs@@ -138,7 +138,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{diff --git a/Emby.Dlna/Profiles/PopcornHourProfile.cs b/Emby.Dlna/Profiles/PopcornHourProfile.csindex 9e9f6966fc..7fbf8c1649 100644--- a/Emby.Dlna/Profiles/PopcornHourProfile.cs+++ b/Emby.Dlna/Profiles/PopcornHourProfile.cs@@ -93,8 +93,8 @@ namespace Emby.Dlna.Profilesnew CodecProfile{Type = CodecType.Video,- Codec="h264",- Conditions = new []+ Codec = "h264",+ Conditions = new[]{new ProfileCondition(ProfileConditionType.EqualsAny, ProfileConditionValue.VideoProfile, "baseline|constrained baseline"),new ProfileCondition@@ -122,7 +122,7 @@ namespace Emby.Dlna.Profilesnew CodecProfile{Type = CodecType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -150,7 +150,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.VideoAudio,Codec = "aac",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -166,7 +166,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.Audio,Codec = "aac",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -182,7 +182,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.Audio,Codec = "mp3",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -202,7 +202,7 @@ namespace Emby.Dlna.Profiles}};- ResponseProfiles = new ResponseProfile[]+ ResponseProfiles = new[]{new ResponseProfile{diff --git a/Emby.Dlna/Profiles/SamsungSmartTvProfile.cs b/Emby.Dlna/Profiles/SamsungSmartTvProfile.csindex 4ff2ab9be2..ddbebba2a4 100644--- a/Emby.Dlna/Profiles/SamsungSmartTvProfile.cs+++ b/Emby.Dlna/Profiles/SamsungSmartTvProfile.cs@@ -139,7 +139,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2013.csindex 238fe9f6bc..765c125045 100644--- a/Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs+++ b/Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs@@ -150,7 +150,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.Video,Codec = "h264",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -178,7 +178,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.VideoAudio,Codec = "ac3",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -197,7 +197,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2014.csindex 812a481513..390c8a3e43 100644--- a/Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs+++ b/Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs@@ -150,7 +150,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.Video,Codec = "h264",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -178,7 +178,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.VideoAudio,Codec = "ac3",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -197,7 +197,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2015.csindex 6bfff322ef..25adc4d022 100644--- a/Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs+++ b/Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs@@ -138,7 +138,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.Video,Codec = "h264",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -166,7 +166,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.VideoAudio,Codec = "ac3",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -185,7 +185,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2016.csindex ec2529574c..0a39a5f401 100644--- a/Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs+++ b/Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs@@ -138,7 +138,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.Video,Codec = "h264",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -166,7 +166,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.VideoAudio,Codec = "ac3",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -185,7 +185,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs b/Emby.Dlna/Profiles/SonyBlurayPlayerProfile.csindex ecdd2e7a4e..05c8ab1c14 100644--- a/Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs+++ b/Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs@@ -114,7 +114,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.Video,Codec = "h264",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -156,7 +156,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.VideoAudio,Codec = "ac3",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -172,7 +172,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.VideoAudio,Codec = "aac",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -191,7 +191,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -217,7 +217,7 @@ namespace Emby.Dlna.ProfilesVideoCodec = "h264,mpeg4,vc1",AudioCodec = "ac3,aac,mp3",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",+ OrgPn = "MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",Type = DlnaProfileType.Video},diff --git a/Emby.Dlna/Profiles/SonyBravia2010Profile.cs b/Emby.Dlna/Profiles/SonyBravia2010Profile.csindex 68365ba4ae..8ab4acd1be 100644--- a/Emby.Dlna/Profiles/SonyBravia2010Profile.cs+++ b/Emby.Dlna/Profiles/SonyBravia2010Profile.cs@@ -102,13 +102,13 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "ts,mpegts",- VideoCodec="h264",- AudioCodec="ac3,aac,mp3",+ VideoCodec = "h264",+ AudioCodec = "ac3,aac,mp3",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",+ OrgPn = "AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",Type = DlnaProfileType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -128,13 +128,13 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "ts,mpegts",- VideoCodec="h264",- AudioCodec="ac3,aac,mp3",+ VideoCodec = "h264",+ AudioCodec = "ac3,aac,mp3",MimeType = "video/mpeg",- OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",+ OrgPn = "AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",Type = DlnaProfileType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -148,28 +148,28 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "ts,mpegts",- VideoCodec="h264",- AudioCodec="ac3,aac,mp3",+ VideoCodec = "h264",+ AudioCodec = "ac3,aac,mp3",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",+ OrgPn = "AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",Type = DlnaProfileType.Video},new ResponseProfile{Container = "ts,mpegts",- VideoCodec="mpeg2video",+ VideoCodec = "mpeg2video",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",+ OrgPn = "MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",Type = DlnaProfileType.Video},new ResponseProfile{Container = "mpeg",- VideoCodec="mpeg1video,mpeg2video",+ VideoCodec = "mpeg1video,mpeg2video",MimeType = "video/mpeg",- OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",+ OrgPn = "MPEG_PS_NTSC,MPEG_PS_PAL",Type = DlnaProfileType.Video}};@@ -180,7 +180,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -204,7 +204,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.Video,Codec = "h264",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -243,7 +243,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.Video,Codec = "mpeg2video",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -275,7 +275,7 @@ namespace Emby.Dlna.Profilesnew CodecProfile{Type = CodecType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -303,7 +303,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.VideoAudio,Codec = "ac3",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -319,7 +319,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.VideoAudio,Codec = "aac",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -341,7 +341,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.VideoAudio,Codec = "mp3,mp2",- Conditions = new []+ Conditions = new[]{new ProfileCondition{diff --git a/Emby.Dlna/Profiles/SonyBravia2011Profile.cs b/Emby.Dlna/Profiles/SonyBravia2011Profile.csindex b34af04a50..42d253394c 100644--- a/Emby.Dlna/Profiles/SonyBravia2011Profile.cs+++ b/Emby.Dlna/Profiles/SonyBravia2011Profile.cs@@ -120,7 +120,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -143,13 +143,13 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "ts,mpegts",- VideoCodec="h264",- AudioCodec="ac3,aac,mp3",+ VideoCodec = "h264",+ AudioCodec = "ac3,aac,mp3",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",+ OrgPn = "AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",Type = DlnaProfileType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -169,13 +169,13 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "ts,mpegts",- VideoCodec="h264",- AudioCodec="ac3,aac,mp3",+ VideoCodec = "h264",+ AudioCodec = "ac3,aac,mp3",MimeType = "video/mpeg",- OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",+ OrgPn = "AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",Type = DlnaProfileType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -189,28 +189,28 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "ts,mpegts",- VideoCodec="h264",- AudioCodec="ac3,aac,mp3",+ VideoCodec = "h264",+ AudioCodec = "ac3,aac,mp3",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",+ OrgPn = "AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",Type = DlnaProfileType.Video},new ResponseProfile{Container = "ts,mpegts",- VideoCodec="mpeg2video",+ VideoCodec = "mpeg2video",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",+ OrgPn = "MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",Type = DlnaProfileType.Video},new ResponseProfile{Container = "mpeg",- VideoCodec="mpeg1video,mpeg2video",+ VideoCodec = "mpeg1video,mpeg2video",MimeType = "video/mpeg",- OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",+ OrgPn = "MPEG_PS_NTSC,MPEG_PS_PAL",Type = DlnaProfileType.Video},new ResponseProfile@@ -227,7 +227,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.Video,Codec = "h264",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -266,7 +266,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.Video,Codec = "mpeg2video",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -298,7 +298,7 @@ namespace Emby.Dlna.Profilesnew CodecProfile{Type = CodecType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -326,7 +326,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.VideoAudio,Codec = "ac3",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -364,7 +364,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.VideoAudio,Codec = "mp3,mp2",- Conditions = new []+ Conditions = new[]{new ProfileCondition{diff --git a/Emby.Dlna/Profiles/SonyBravia2012Profile.cs b/Emby.Dlna/Profiles/SonyBravia2012Profile.csindex 0e75d0cb5e..0598e83422 100644--- a/Emby.Dlna/Profiles/SonyBravia2012Profile.cs+++ b/Emby.Dlna/Profiles/SonyBravia2012Profile.cs@@ -131,13 +131,13 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "ts,mpegts",- VideoCodec="h264",- AudioCodec="ac3,aac,mp3",+ VideoCodec = "h264",+ AudioCodec = "ac3,aac,mp3",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",+ OrgPn = "AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",Type = DlnaProfileType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -157,13 +157,13 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "ts,mpegts",- VideoCodec="h264",- AudioCodec="ac3,aac,mp3",+ VideoCodec = "h264",+ AudioCodec = "ac3,aac,mp3",MimeType = "video/mpeg",- OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",+ OrgPn = "AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",Type = DlnaProfileType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -177,28 +177,28 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "ts,mpegts",- VideoCodec="h264",- AudioCodec="ac3,aac,mp3",+ VideoCodec = "h264",+ AudioCodec = "ac3,aac,mp3",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",+ OrgPn = "AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",Type = DlnaProfileType.Video},new ResponseProfile{Container = "ts,mpegts",- VideoCodec="mpeg2video",+ VideoCodec = "mpeg2video",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",+ OrgPn = "MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",Type = DlnaProfileType.Video},new ResponseProfile{Container = "mpeg",- VideoCodec="mpeg1video,mpeg2video",+ VideoCodec = "mpeg1video,mpeg2video",MimeType = "video/mpeg",- OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",+ OrgPn = "MPEG_PS_NTSC,MPEG_PS_PAL",Type = DlnaProfileType.Video},new ResponseProfile@@ -215,7 +215,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -282,7 +282,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.VideoAudio,Codec = "mp3,mp2",- Conditions = new []+ Conditions = new[]{new ProfileCondition{diff --git a/Emby.Dlna/Profiles/SonyBravia2013Profile.cs b/Emby.Dlna/Profiles/SonyBravia2013Profile.csindex 3300863c90..3d90a1e72d 100644--- a/Emby.Dlna/Profiles/SonyBravia2013Profile.cs+++ b/Emby.Dlna/Profiles/SonyBravia2013Profile.cs@@ -164,7 +164,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -187,13 +187,13 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "ts,mpegts",- VideoCodec="h264",- AudioCodec="ac3,aac,mp3",+ VideoCodec = "h264",+ AudioCodec = "ac3,aac,mp3",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",+ OrgPn = "AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",Type = DlnaProfileType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -213,13 +213,13 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "ts,mpegts",- VideoCodec="h264",- AudioCodec="ac3,aac,mp3",+ VideoCodec = "h264",+ AudioCodec = "ac3,aac,mp3",MimeType = "video/mpeg",- OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",+ OrgPn = "AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",Type = DlnaProfileType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -233,28 +233,28 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "ts,mpegts",- VideoCodec="h264",- AudioCodec="ac3,aac,mp3",+ VideoCodec = "h264",+ AudioCodec = "ac3,aac,mp3",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",+ OrgPn = "AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",Type = DlnaProfileType.Video},new ResponseProfile{Container = "ts,mpegts",- VideoCodec="mpeg2video",+ VideoCodec = "mpeg2video",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",+ OrgPn = "MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",Type = DlnaProfileType.Video},new ResponseProfile{Container = "mpeg",- VideoCodec="mpeg1video,mpeg2video",+ VideoCodec = "mpeg1video,mpeg2video",MimeType = "video/mpeg",- OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",+ OrgPn = "MPEG_PS_NTSC,MPEG_PS_PAL",Type = DlnaProfileType.Video},new ResponseProfile@@ -265,14 +265,13 @@ namespace Emby.Dlna.Profiles}};-CodecProfiles = new[]{new CodecProfile{Type = CodecType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -300,7 +299,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.VideoAudio,Codec = "mp3,mp2",- Conditions = new []+ Conditions = new[]{new ProfileCondition{diff --git a/Emby.Dlna/Profiles/SonyBravia2014Profile.cs b/Emby.Dlna/Profiles/SonyBravia2014Profile.csindex 4e833441cc..9188f73ef1 100644--- a/Emby.Dlna/Profiles/SonyBravia2014Profile.cs+++ b/Emby.Dlna/Profiles/SonyBravia2014Profile.cs@@ -164,7 +164,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -187,13 +187,13 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "ts,mpegts",- VideoCodec="h264",- AudioCodec="ac3,aac,mp3",+ VideoCodec = "h264",+ AudioCodec = "ac3,aac,mp3",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",+ OrgPn = "AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",Type = DlnaProfileType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -213,13 +213,13 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "ts,mpegts",- VideoCodec="h264",- AudioCodec="ac3,aac,mp3",+ VideoCodec = "h264",+ AudioCodec = "ac3,aac,mp3",MimeType = "video/mpeg",- OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",+ OrgPn = "AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",Type = DlnaProfileType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -233,28 +233,28 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "ts,mpegts",- VideoCodec="h264",- AudioCodec="ac3,aac,mp3",+ VideoCodec = "h264",+ AudioCodec = "ac3,aac,mp3",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",+ OrgPn = "AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",Type = DlnaProfileType.Video},new ResponseProfile{Container = "ts,mpegts",- VideoCodec="mpeg2video",+ VideoCodec = "mpeg2video",MimeType = "video/vnd.dlna.mpeg-tts",- OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",+ OrgPn = "MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",Type = DlnaProfileType.Video},new ResponseProfile{Container = "mpeg",- VideoCodec="mpeg1video,mpeg2video",+ VideoCodec = "mpeg1video,mpeg2video",MimeType = "video/mpeg",- OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",+ OrgPn = "MPEG_PS_NTSC,MPEG_PS_PAL",Type = DlnaProfileType.Video},new ResponseProfile@@ -265,14 +265,13 @@ namespace Emby.Dlna.Profiles}};-CodecProfiles = new[]{new CodecProfile{Type = CodecType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -300,7 +299,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.VideoAudio,Codec = "mp3,mp2",- Conditions = new []+ Conditions = new[]{new ProfileCondition{diff --git a/Emby.Dlna/Profiles/SonyPs3Profile.cs b/Emby.Dlna/Profiles/SonyPs3Profile.csindex 7f72356bdc..d56b1df507 100644--- a/Emby.Dlna/Profiles/SonyPs3Profile.cs+++ b/Emby.Dlna/Profiles/SonyPs3Profile.cs@@ -108,7 +108,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -133,7 +133,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.Video,Codec = "h264",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -176,7 +176,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.VideoAudio,Codec = "ac3",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -201,7 +201,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.VideoAudio,Codec = "wmapro",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -217,7 +217,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.VideoAudio,Codec = "aac",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -235,7 +235,7 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "mp4,mov",- AudioCodec="aac",+ AudioCodec = "aac",MimeType = "video/mp4",Type = DlnaProfileType.Video},@@ -244,7 +244,7 @@ namespace Emby.Dlna.Profiles{Container = "avi",MimeType = "video/divx",- OrgPn="AVI",+ OrgPn = "AVI",Type = DlnaProfileType.Video},diff --git a/Emby.Dlna/Profiles/SonyPs4Profile.cs b/Emby.Dlna/Profiles/SonyPs4Profile.csindex 411bfe2b0c..db56094e2b 100644--- a/Emby.Dlna/Profiles/SonyPs4Profile.cs+++ b/Emby.Dlna/Profiles/SonyPs4Profile.cs@@ -110,7 +110,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -135,7 +135,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.Video,Codec = "h264",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -178,7 +178,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.VideoAudio,Codec = "ac3",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -203,7 +203,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.VideoAudio,Codec = "wmapro",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -219,7 +219,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.VideoAudio,Codec = "aac",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -237,7 +237,7 @@ namespace Emby.Dlna.Profilesnew ResponseProfile{Container = "mp4,mov",- AudioCodec="aac",+ AudioCodec = "aac",MimeType = "video/mp4",Type = DlnaProfileType.Video},@@ -246,7 +246,7 @@ namespace Emby.Dlna.Profiles{Container = "avi",MimeType = "video/divx",- OrgPn="AVI",+ OrgPn = "AVI",Type = DlnaProfileType.Video},diff --git a/Emby.Dlna/Profiles/WdtvLiveProfile.cs b/Emby.Dlna/Profiles/WdtvLiveProfile.csindex 2de9a8cd9e..937ca0f425 100644--- a/Emby.Dlna/Profiles/WdtvLiveProfile.cs+++ b/Emby.Dlna/Profiles/WdtvLiveProfile.cs@@ -20,7 +20,7 @@ namespace Emby.Dlna.ProfilesHeaders = new[]{- new HttpHeaderInfo {Name = "User-Agent", Value = "alphanetworks", Match = HeaderMatchType.Substring},+ new HttpHeaderInfo { Name = "User-Agent", Value = "alphanetworks", Match = HeaderMatchType.Substring },new HttpHeaderInfo{Name = "User-Agent",@@ -168,7 +168,7 @@ namespace Emby.Dlna.Profiles{Type = DlnaProfileType.Photo,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -193,7 +193,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.Video,Codec = "h264",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -221,7 +221,7 @@ namespace Emby.Dlna.ProfilesType = CodecType.VideoAudio,Codec = "aac",- Conditions = new []+ Conditions = new[]{new ProfileCondition{diff --git a/Emby.Dlna/Profiles/XboxOneProfile.cs b/Emby.Dlna/Profiles/XboxOneProfile.csindex 2cbe4e6acb..84d8184a22 100644--- a/Emby.Dlna/Profiles/XboxOneProfile.cs+++ b/Emby.Dlna/Profiles/XboxOneProfile.cs@@ -119,7 +119,7 @@ namespace Emby.Dlna.ProfilesType = DlnaProfileType.Video,Container = "mp4,mov",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -138,7 +138,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.Video,Codec = "mpeg4",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -187,7 +187,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.Video,Codec = "h264",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -236,7 +236,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.Video,Codec = "wmv2,wmv3,vc1",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -284,7 +284,7 @@ namespace Emby.Dlna.Profilesnew CodecProfile{Type = CodecType.Video,- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -307,7 +307,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.VideoAudio,Codec = "ac3,wmav2,wmapro",- Conditions = new []+ Conditions = new[]{new ProfileCondition{@@ -323,7 +323,7 @@ namespace Emby.Dlna.Profiles{Type = CodecType.VideoAudio,Codec = "aac",- Conditions = new []+ Conditions = new[]{new ProfileCondition{diff --git a/Emby.Dlna/Service/BaseControlHandler.cs b/Emby.Dlna/Service/BaseControlHandler.csindex 699d325eac..a795d45215 100644--- a/Emby.Dlna/Service/BaseControlHandler.cs+++ b/Emby.Dlna/Service/BaseControlHandler.cs@@ -15,11 +15,7 @@ namespace Emby.Dlna.Service{public abstract class BaseControlHandler{- private const string NS_SOAPENV = "http://schemas.xmlsoap.org/soap/envelope/";-- protected IServerConfigurationManager Config { get; }-- protected ILogger Logger { get; }+ private const string NsSoapenv = "http://schemas.xmlsoap.org/soap/envelope/";protected BaseControlHandler(IServerConfigurationManager config, ILogger logger){@@ -27,6 +23,10 @@ namespace Emby.Dlna.ServiceLogger = logger;}+ protected IServerConfigurationManager Config { get; }++ protected ILogger Logger { get; }+public async Task<ControlResponse> ProcessControlRequestAsync(ControlRequest request){try@@ -80,10 +80,10 @@ namespace Emby.Dlna.Service{writer.WriteStartDocument(true);- writer.WriteStartElement("SOAP-ENV", "Envelope", NS_SOAPENV);- writer.WriteAttributeString(string.Empty, "encodingStyle", NS_SOAPENV, "http://schemas.xmlsoap.org/soap/encoding/");+ writer.WriteStartElement("SOAP-ENV", "Envelope", NsSoapenv);+ writer.WriteAttributeString(string.Empty, "encodingStyle", NsSoapenv, "http://schemas.xmlsoap.org/soap/encoding/");- writer.WriteStartElement("SOAP-ENV", "Body", NS_SOAPENV);+ writer.WriteStartElement("SOAP-ENV", "Body", NsSoapenv);writer.WriteStartElement("u", requestInfo.LocalName + "Response", requestInfo.NamespaceURI);WriteResult(requestInfo.LocalName, requestInfo.Headers, writer);diff --git a/Emby.Dlna/Service/BaseService.cs b/Emby.Dlna/Service/BaseService.csindex 8794ec26a8..88c62f86c1 100644--- a/Emby.Dlna/Service/BaseService.cs+++ b/Emby.Dlna/Service/BaseService.cs@@ -8,31 +8,31 @@ namespace Emby.Dlna.Service{public class BaseService : IEventManager{- protected IEventManager EventManager;- protected IHttpClient HttpClient;+ protected IEventManager _eventManager;+ protected IHttpClient _httpClient;protected ILogger Logger;protected BaseService(ILogger<BaseService> logger, IHttpClient httpClient){Logger = logger;- HttpClient = httpClient;+ _httpClient = httpClient;- EventManager = new EventManager(logger, HttpClient);+ _eventManager = new EventManager(logger, _httpClient);}public EventSubscriptionResponse CancelEventSubscription(string subscriptionId){- return EventManager.CancelEventSubscription(subscriptionId);+ return _eventManager.CancelEventSubscription(subscriptionId);}public EventSubscriptionResponse RenewEventSubscription(string subscriptionId, string notificationType, string timeoutString, string callbackUrl){- return EventManager.RenewEventSubscription(subscriptionId, notificationType, timeoutString, callbackUrl);+ return _eventManager.RenewEventSubscription(subscriptionId, notificationType, timeoutString, callbackUrl);}public EventSubscriptionResponse CreateEventSubscription(string notificationType, string timeoutString, string callbackUrl){- return EventManager.CreateEventSubscription(notificationType, timeoutString, callbackUrl);+ return _eventManager.CreateEventSubscription(notificationType, timeoutString, callbackUrl);}}}diff --git a/Emby.Dlna/Service/ControlErrorHandler.cs b/Emby.Dlna/Service/ControlErrorHandler.csindex 047e9f0142..253a48d05d 100644--- a/Emby.Dlna/Service/ControlErrorHandler.cs+++ b/Emby.Dlna/Service/ControlErrorHandler.cs@@ -10,7 +10,7 @@ namespace Emby.Dlna.Service{public static class ControlErrorHandler{- private const string NS_SOAPENV = "http://schemas.xmlsoap.org/soap/envelope/";+ private const string NsSoapenv = "http://schemas.xmlsoap.org/soap/envelope/";public static ControlResponse GetResponse(Exception ex){@@ -26,11 +26,11 @@ namespace Emby.Dlna.Service{writer.WriteStartDocument(true);- writer.WriteStartElement("SOAP-ENV", "Envelope", NS_SOAPENV);- writer.WriteAttributeString(string.Empty, "encodingStyle", NS_SOAPENV, "http://schemas.xmlsoap.org/soap/encoding/");+ writer.WriteStartElement("SOAP-ENV", "Envelope", NsSoapenv);+ writer.WriteAttributeString(string.Empty, "encodingStyle", NsSoapenv, "http://schemas.xmlsoap.org/soap/encoding/");- writer.WriteStartElement("SOAP-ENV", "Body", NS_SOAPENV);- writer.WriteStartElement("SOAP-ENV", "Fault", NS_SOAPENV);+ writer.WriteStartElement("SOAP-ENV", "Body", NsSoapenv);+ writer.WriteStartElement("SOAP-ENV", "Fault", NsSoapenv);writer.WriteElementString("faultcode", "500");writer.WriteElementString("faultstring", ex.Message);diff --git a/Emby.Dlna/Ssdp/DeviceDiscovery.cs b/Emby.Dlna/Ssdp/DeviceDiscovery.csindex 7daac96d1d..7c4c0f6d9b 100644--- a/Emby.Dlna/Ssdp/DeviceDiscovery.cs+++ b/Emby.Dlna/Ssdp/DeviceDiscovery.cs@@ -17,9 +17,17 @@ namespace Emby.Dlna.Ssdpprivate readonly IServerConfigurationManager _config;+ private SsdpDeviceLocator _deviceLocator;+ private ISsdpCommunicationsServer _commsServer;+private int _listenerCount;private bool _disposed;+ public DeviceDiscovery(IServerConfigurationManager config)+ {+ _config = config;+ }+private event EventHandler<GenericEventArgs<UpnpDeviceInfo>> DeviceDiscoveredInternal;/// <inheritdoc />@@ -49,15 +57,6 @@ namespace Emby.Dlna.Ssdp/// <inheritdoc />public event EventHandler<GenericEventArgs<UpnpDeviceInfo>> DeviceLeft;- private SsdpDeviceLocator _deviceLocator;-- private ISsdpCommunicationsServer _commsServer;-- public DeviceDiscovery(IServerConfigurationManager config)- {- _config = config;- }-// Call this method from somewhere in your code to start the search.public void Start(ISsdpCommunicationsServer communicationsServer){