From 4432b88281cbd489ac4a71a8e9635c6325ccd168 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 26 Oct 2017 23:05:29 -0400 Subject: [PATCH 1/9] update network detection --- Emby.Server.Implementations/Networking/NetworkManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Networking/NetworkManager.cs b/Emby.Server.Implementations/Networking/NetworkManager.cs index 66b2cba39b..db2c455fba 100644 --- a/Emby.Server.Implementations/Networking/NetworkManager.cs +++ b/Emby.Server.Implementations/Networking/NetworkManager.cs @@ -103,7 +103,9 @@ namespace Emby.Server.Implementations.Networking } return endpoint.StartsWith("localhost", StringComparison.OrdinalIgnoreCase) || - endpoint.StartsWith("127.0.0.1", StringComparison.OrdinalIgnoreCase) || + endpoint.StartsWith("127.", StringComparison.OrdinalIgnoreCase) || + endpoint.StartsWith("192.168", StringComparison.OrdinalIgnoreCase) || + endpoint.StartsWith("169.", StringComparison.OrdinalIgnoreCase) || IsInPrivateAddressSpaceAndLocalSubnet(endpoint); } From 88caeaa783d8d6a7d2d17c98955fa4bc8264d446 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 26 Oct 2017 23:43:06 -0400 Subject: [PATCH 2/9] update address detection --- .../Networking/NetworkManager.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Emby.Server.Implementations/Networking/NetworkManager.cs b/Emby.Server.Implementations/Networking/NetworkManager.cs index db2c455fba..be85db80a1 100644 --- a/Emby.Server.Implementations/Networking/NetworkManager.cs +++ b/Emby.Server.Implementations/Networking/NetworkManager.cs @@ -113,7 +113,6 @@ namespace Emby.Server.Implementations.Networking { var endpointFirstPart = endpoint.Split('.')[0]; - string subnet_Match = ""; if ( endpoint.StartsWith("127.", StringComparison.OrdinalIgnoreCase) || endpoint.StartsWith("10.", StringComparison.OrdinalIgnoreCase) || @@ -122,7 +121,9 @@ namespace Emby.Server.Implementations.Networking ) { foreach (NetworkInterface adapter in NetworkInterface.GetAllNetworkInterfaces()) + { foreach (UnicastIPAddressInformation unicastIPAddressInformation in adapter.GetIPProperties().UnicastAddresses) + { if (unicastIPAddressInformation.Address.AddressFamily == AddressFamily.InterNetwork && endpointFirstPart == unicastIPAddressInformation.Address.ToString().Split('.')[0]) { int subnet_Test = 0; @@ -132,11 +133,18 @@ namespace Emby.Server.Implementations.Networking subnet_Test++; } - subnet_Match = String.Join(".", unicastIPAddressInformation.Address.ToString().Split('.').Take(subnet_Test).ToArray()); + var subnet_Match = String.Join(".", unicastIPAddressInformation.Address.ToString().Split('.').Take(subnet_Test).ToArray()); + + if (endpoint.StartsWith(subnet_Match + ".", StringComparison.OrdinalIgnoreCase)) + { + return true; + } } + } + } } - return endpoint.StartsWith(subnet_Match + ".", StringComparison.OrdinalIgnoreCase); + return false; } private Dictionary _subnetLookup = new Dictionary(StringComparer.Ordinal); From ca2e7a4195e290c5327f5edbe5688ca7c8a661a8 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 26 Oct 2017 23:49:56 -0400 Subject: [PATCH 3/9] deprecate localized guids config switch --- .../HttpClientManager/HttpClientManager.cs | 17 ----------------- .../Library/LibraryManager.cs | 2 +- MediaBrowser.Api/StartupWizardService.cs | 1 - MediaBrowser.Common/Net/HttpRequestOptions.cs | 1 - .../Configuration/ServerConfiguration.cs | 2 -- SharedVersion.cs | 2 +- 6 files changed, 2 insertions(+), 23 deletions(-) diff --git a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs index ef95b47c38..cd7c98dc85 100644 --- a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs +++ b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs @@ -124,18 +124,6 @@ namespace Emby.Server.Implementations.HttpClientManager } } - private void AddIpv4Option(HttpWebRequest request, HttpRequestOptions options) - { - request.ServicePoint.BindIPEndPointDelegate = (servicePount, remoteEndPoint, retryCount) => - { - if (remoteEndPoint.AddressFamily == AddressFamily.InterNetwork) - { - return new IPEndPoint(IPAddress.Any, 0); - } - throw new InvalidOperationException("no IPv4 address"); - }; - } - private WebRequest GetRequest(HttpRequestOptions options, string method) { var url = options.Url; @@ -153,11 +141,6 @@ namespace Emby.Server.Implementations.HttpClientManager if (httpWebRequest != null) { - if (options.PreferIpv4) - { - AddIpv4Option(httpWebRequest, options); - } - AddRequestHeaders(httpWebRequest, options); if (options.EnableHttpCompression) diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index cac1cb3b4b..bd8a095503 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -506,7 +506,7 @@ namespace Emby.Server.Implementations.Library throw new ArgumentNullException("type"); } - if (ConfigurationManager.Configuration.EnableLocalizedGuids && key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath)) + if (key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath)) { // Try to normalize paths located underneath program-data in an attempt to make them more portable key = key.Substring(ConfigurationManager.ApplicationPaths.ProgramDataPath.Length) diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs index 52a5e444f3..1ccb683204 100644 --- a/MediaBrowser.Api/StartupWizardService.cs +++ b/MediaBrowser.Api/StartupWizardService.cs @@ -91,7 +91,6 @@ namespace MediaBrowser.Api { config.EnableCaseSensitiveItemIds = true; config.SkipDeserializationForBasicTypes = true; - config.EnableLocalizedGuids = true; config.EnableSimpleArtistDetection = true; config.EnableNormalizedItemByNameIds = true; config.DisableLiveTvChannelUserDataName = true; diff --git a/MediaBrowser.Common/Net/HttpRequestOptions.cs b/MediaBrowser.Common/Net/HttpRequestOptions.cs index 51859ecdb5..0a279fa9cc 100644 --- a/MediaBrowser.Common/Net/HttpRequestOptions.cs +++ b/MediaBrowser.Common/Net/HttpRequestOptions.cs @@ -101,7 +101,6 @@ namespace MediaBrowser.Common.Net public TimeSpan CacheLength { get; set; } public int TimeoutMs { get; set; } - public bool PreferIpv4 { get; set; } public bool EnableDefaultUserAgent { get; set; } public bool AppendCharsetToMimeType { get; set; } diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 65b054b0c7..f2c3b7cc8a 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -46,7 +46,6 @@ namespace MediaBrowser.Model.Configuration /// /// true if [use HTTPS]; otherwise, false. public bool EnableHttps { get; set; } - public bool EnableLocalizedGuids { get; set; } public bool EnableNormalizedItemByNameIds { get; set; } /// @@ -198,7 +197,6 @@ namespace MediaBrowser.Model.Configuration LocalNetworkAddresses = new string[] { }; CodecsUsed = new string[] { }; ImageExtractionTimeoutMs = 0; - EnableLocalizedGuids = true; PathSubstitutions = new PathSubstitution[] { }; EnableSimpleArtistDetection = true; diff --git a/SharedVersion.cs b/SharedVersion.cs index 7e6965cbc3..b574a61350 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.33.20")] +[assembly: AssemblyVersion("3.2.34.1")] From 902101355acb66451b32a8044b54c3ec17afc307 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 26 Oct 2017 23:50:17 -0400 Subject: [PATCH 4/9] add dc:creator --- Emby.Dlna/Didl/DidlBuilder.cs | 50 +++++++++++------------------------ 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/Emby.Dlna/Didl/DidlBuilder.cs b/Emby.Dlna/Didl/DidlBuilder.cs index 5b18a2b7c2..a6fa187d4c 100644 --- a/Emby.Dlna/Didl/DidlBuilder.cs +++ b/Emby.Dlna/Didl/DidlBuilder.cs @@ -860,55 +860,35 @@ namespace Emby.Dlna.Didl { AddCommonFields(item, itemStubType, context, writer, filter); - var audio = item as Audio; + var hasArtists = item as IHasArtist; + var hasAlbumArtists = item as IHasAlbumArtist; - if (audio != null) + if (hasArtists != null) { - foreach (var artist in audio.Artists) + foreach (var artist in hasArtists.Artists) { AddValue(writer, "upnp", "artist", artist, NS_UPNP); - } + AddValue(writer, "dc", "creator", artist, NS_DC); - if (!string.IsNullOrEmpty(audio.Album)) - { - AddValue(writer, "upnp", "album", audio.Album, NS_UPNP); - } - - foreach (var artist in audio.AlbumArtists) - { - AddAlbumArtist(writer, artist); + // If it doesn't support album artists (musicvideo), then tag as both + if (hasAlbumArtists == null) + { + AddAlbumArtist(writer, artist); + } } } - var album = item as MusicAlbum; - - if (album != null) + if (hasAlbumArtists != null) { - foreach (var artist in album.AlbumArtists) + foreach (var albumArtist in hasAlbumArtists.AlbumArtists) { - AddAlbumArtist(writer, artist); - AddValue(writer, "upnp", "artist", artist, NS_UPNP); - } - foreach (var artist in album.Artists) - { - AddValue(writer, "upnp", "artist", artist, NS_UPNP); + AddAlbumArtist(writer, albumArtist); } } - var musicVideo = item as MusicVideo; - - if (musicVideo != null) + if (!string.IsNullOrWhiteSpace(item.Album)) { - foreach (var artist in musicVideo.Artists) - { - AddValue(writer, "upnp", "artist", artist, NS_UPNP); - AddAlbumArtist(writer, artist); - } - - if (!string.IsNullOrEmpty(musicVideo.Album)) - { - AddValue(writer, "upnp", "album", musicVideo.Album, NS_UPNP); - } + AddValue(writer, "upnp", "album", item.Album, NS_UPNP); } if (item.IndexNumber.HasValue) From 44a270fa6fed9ef806e02a200af0bb14b5cf0a0e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 27 Oct 2017 00:14:45 -0400 Subject: [PATCH 5/9] cache subnet results --- .../Networking/NetworkManager.cs | 76 +++++++++---------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/Emby.Server.Implementations/Networking/NetworkManager.cs b/Emby.Server.Implementations/Networking/NetworkManager.cs index be85db80a1..7664ed4423 100644 --- a/Emby.Server.Implementations/Networking/NetworkManager.cs +++ b/Emby.Server.Implementations/Networking/NetworkManager.cs @@ -120,6 +120,36 @@ namespace Emby.Server.Implementations.Networking endpoint.StartsWith("169.", StringComparison.OrdinalIgnoreCase) ) { + var subnets = GetSubnets(endpointFirstPart); + + foreach (var subnet_Match in subnets) + { + //Logger.Debug("subnet_Match:" + subnet_Match); + + if (endpoint.StartsWith(subnet_Match + ".", StringComparison.OrdinalIgnoreCase)) + { + return true; + } + } + } + + return false; + } + + private Dictionary> _subnetLookup = new Dictionary>(StringComparer.Ordinal); + private List GetSubnets(string endpointFirstPart) + { + List subnets; + + lock (_subnetLookup) + { + if (_subnetLookup.TryGetValue(endpointFirstPart, out subnets)) + { + return subnets; + } + + subnets = new List(); + foreach (NetworkInterface adapter in NetworkInterface.GetAllNetworkInterfaces()) { foreach (UnicastIPAddressInformation unicastIPAddressInformation in adapter.GetIPProperties().UnicastAddresses) @@ -135,51 +165,19 @@ namespace Emby.Server.Implementations.Networking var subnet_Match = String.Join(".", unicastIPAddressInformation.Address.ToString().Split('.').Take(subnet_Test).ToArray()); - if (endpoint.StartsWith(subnet_Match + ".", StringComparison.OrdinalIgnoreCase)) + // TODO: Is this check necessary? + if (adapter.OperationalStatus == OperationalStatus.Up) { - return true; + subnets.Add(subnet_Match); } } } } + + _subnetLookup[endpointFirstPart] = subnets; + + return subnets; } - - return false; - } - - private Dictionary _subnetLookup = new Dictionary(StringComparer.Ordinal); - private string GetSubnet(string endpointFirstPart) - { - string subnet_Match = ""; - - lock (_subnetLookup) - { - if (_subnetLookup.TryGetValue(endpointFirstPart, out subnet_Match)) - { - return subnet_Match; - } - - foreach (NetworkInterface adapter in NetworkInterface.GetAllNetworkInterfaces()) - foreach (UnicastIPAddressInformation unicastIPAddressInformation in adapter.GetIPProperties().UnicastAddresses) - if (unicastIPAddressInformation.Address.AddressFamily == AddressFamily.InterNetwork && endpointFirstPart == unicastIPAddressInformation.Address.ToString().Split('.')[0]) - { - int subnet_Test = 0; - foreach (string part in unicastIPAddressInformation.IPv4Mask.ToString().Split('.')) - { - if (part.Equals("0")) break; - subnet_Test++; - } - - subnet_Match = String.Join(".", unicastIPAddressInformation.Address.ToString().Split('.').Take(subnet_Test).ToArray()); - } - - if (!string.IsNullOrWhiteSpace(subnet_Match)) - { - _subnetLookup[endpointFirstPart] = subnet_Match; - } - } - - return subnet_Match; } private bool Is172AddressPrivate(string endpoint) From 7cd1416d276cfede3de315cde434b5d78936e011 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 28 Oct 2017 00:19:38 -0400 Subject: [PATCH 6/9] fix music artists not showing in collections --- .../Channels/RefreshChannelsScheduledTask.cs | 27 +++++++++++-------- .../LiveTv/Listings/SchedulesDirect.cs | 16 +++++++++++ MediaBrowser.Controller/Entities/Folder.cs | 2 +- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs b/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs index 4a33012529..0208183614 100644 --- a/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs +++ b/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs @@ -9,7 +9,7 @@ using MediaBrowser.Model.Tasks; namespace Emby.Server.Implementations.Channels { - class RefreshChannelsScheduledTask : IScheduledTask + class RefreshChannelsScheduledTask : IScheduledTask, IConfigurableScheduledTask { private readonly IChannelManager _channelManager; private readonly IUserManager _userManager; @@ -39,6 +39,21 @@ namespace Emby.Server.Implementations.Channels get { return "Internet Channels"; } } + public bool IsHidden + { + get { return ((ChannelManager)_channelManager).Channels.Length == 0; } + } + + public bool IsEnabled + { + get { return true; } + } + + public bool IsLogged + { + get { return true; } + } + public async Task Execute(System.Threading.CancellationToken cancellationToken, IProgress progress) { var manager = (ChannelManager)_channelManager; @@ -65,15 +80,5 @@ namespace Emby.Server.Implementations.Channels { get { return "RefreshInternetChannels"; } } - - public bool IsHidden - { - get { return false; } - } - - public bool IsEnabled - { - get { return true; } - } } } diff --git a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs index b3c7ecc9f3..e210e2224e 100644 --- a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs +++ b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs @@ -653,6 +653,14 @@ namespace Emby.Server.Implementations.LiveTv.Listings // Schedules direct requires that the client support compression and will return a 400 response without it options.EnableHttpCompression = true; + // On windows 7 under .net core, this header is not getting added +#if NETSTANDARD2_0 + if (Environment.OSVersion.Platform == PlatformID.Win32NT) + { + options.RequestHeaders["Accept-Encoding"] = "deflate"; + } +#endif + try { return await _httpClient.Post(options).ConfigureAwait(false); @@ -684,6 +692,14 @@ namespace Emby.Server.Implementations.LiveTv.Listings // Schedules direct requires that the client support compression and will return a 400 response without it options.EnableHttpCompression = true; + // On windows 7 under .net core, this header is not getting added +#if NETSTANDARD2_0 + if (Environment.OSVersion.Platform == PlatformID.Win32NT) + { + options.RequestHeaders["Accept-Encoding"] = "deflate"; + } +#endif + try { return await _httpClient.SendAsync(options, "GET").ConfigureAwait(false); diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index ce7145a791..12183aec2f 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -1266,7 +1266,7 @@ namespace MediaBrowser.Controller.Entities var childOwner = child.IsOwnedItem ? (child.GetOwner() ?? child) : child; - if (childOwner != null) + if (childOwner != null && !(child is IItemByName)) { var childLocationType = childOwner.LocationType; if (childLocationType == LocationType.Remote || childLocationType == LocationType.Virtual) From 5106819a4b9bdcc12535f47cbdc447970140f479 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 28 Oct 2017 00:20:18 -0400 Subject: [PATCH 7/9] show album artist in album identify wizard --- .../Providers/RemoteSearchResult.cs | 2 + .../Music/MusicBrainzAlbumProvider.cs | 163 ++++++++++++++++++ 2 files changed, 165 insertions(+) diff --git a/MediaBrowser.Model/Providers/RemoteSearchResult.cs b/MediaBrowser.Model/Providers/RemoteSearchResult.cs index 72b6632e4c..fdff7ba462 100644 --- a/MediaBrowser.Model/Providers/RemoteSearchResult.cs +++ b/MediaBrowser.Model/Providers/RemoteSearchResult.cs @@ -34,6 +34,8 @@ namespace MediaBrowser.Model.Providers public string GameSystem { get; set; } public string Overview { get; set; } + public RemoteSearchResult AlbumArtist { get; set; } + public RemoteSearchResult() { ProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase); diff --git a/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs b/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs index b54d14935e..3befca4289 100644 --- a/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs +++ b/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs @@ -117,6 +117,17 @@ namespace MediaBrowser.Providers.Music ProductionYear = i.Year }; + if (i.Artists.Count > 0) + { + result.AlbumArtist = new RemoteSearchResult + { + SearchProviderName = Name, + Name = i.Artists[0].Item1 + }; + + result.AlbumArtist.SetProviderId(MetadataProviders.MusicBrainzArtist, i.Artists[0].Item2); + } + if (!string.IsNullOrWhiteSpace(i.ReleaseId)) { result.SetProviderId(MetadataProviders.MusicBrainzAlbum, i.ReleaseId); @@ -285,6 +296,8 @@ namespace MediaBrowser.Providers.Music public string Overview; public int? Year; + public List> Artists = new List>(); + public static List Parse(XmlReader reader) { reader.MoveToContent(); @@ -417,6 +430,32 @@ namespace MediaBrowser.Providers.Music { result.ReleaseGroupId = reader.GetAttribute("id"); reader.Skip(); + break; + } + case "artist-credit": + { + // TODO + + /* + * + + +SARCASTIC+ZOOKEEPER +SARCASTIC+ZOOKEEPER + + + + */ + using (var subReader = reader.ReadSubtree()) + { + var artist = ParseArtistCredit(subReader); + + if (artist != null) + { + result.Artists.Add(artist); + } + } + break; } default: @@ -436,6 +475,130 @@ namespace MediaBrowser.Providers.Music } } + private static Tuple ParseArtistCredit(XmlReader reader) + { + reader.MoveToContent(); + reader.Read(); + + // http://stackoverflow.com/questions/2299632/why-does-xmlreader-skip-every-other-element-if-there-is-no-whitespace-separator + + // Loop through each element + while (!reader.EOF && reader.ReadState == ReadState.Interactive) + { + if (reader.NodeType == XmlNodeType.Element) + { + switch (reader.Name) + { + case "name-credit": + { + using (var subReader = reader.ReadSubtree()) + { + return ParseArtistNameCredit(subReader); + } + } + default: + { + reader.Skip(); + break; + } + } + } + else + { + reader.Read(); + } + } + + return null; + } + + private static Tuple ParseArtistNameCredit(XmlReader reader) + { + reader.MoveToContent(); + reader.Read(); + + string name = null; + + // http://stackoverflow.com/questions/2299632/why-does-xmlreader-skip-every-other-element-if-there-is-no-whitespace-separator + + // Loop through each element + while (!reader.EOF && reader.ReadState == ReadState.Interactive) + { + if (reader.NodeType == XmlNodeType.Element) + { + switch (reader.Name) + { + case "artist": + { + var id = reader.GetAttribute("id"); + using (var subReader = reader.ReadSubtree()) + { + return ParseArtistArtistCredit(subReader, id); + } + } + default: + { + reader.Skip(); + break; + } + } + } + else + { + reader.Read(); + } + } + + if (string.IsNullOrWhiteSpace(name)) + { + return null; + } + + return new Tuple(name, null); + } + + private static Tuple ParseArtistArtistCredit(XmlReader reader, string artistId) + { + reader.MoveToContent(); + reader.Read(); + + string name = null; + + // http://stackoverflow.com/questions/2299632/why-does-xmlreader-skip-every-other-element-if-there-is-no-whitespace-separator + + // Loop through each element + while (!reader.EOF && reader.ReadState == ReadState.Interactive) + { + if (reader.NodeType == XmlNodeType.Element) + { + switch (reader.Name) + { + case "name": + { + name = reader.ReadElementContentAsString(); + break; + } + default: + { + reader.Skip(); + break; + } + } + } + else + { + reader.Read(); + } + } + + if (string.IsNullOrWhiteSpace(name)) + { + return null; + } + + return new Tuple(name, artistId); + } + private async Task GetReleaseIdFromReleaseGroupId(string releaseGroupId, CancellationToken cancellationToken) { var url = string.Format("/ws/2/release?release-group={0}", releaseGroupId); From 17d33c0fb8aa19e6afab77bd6ecdd66a9c69e050 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 28 Oct 2017 00:20:45 -0400 Subject: [PATCH 8/9] 3.2.34.2 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index b574a61350..1a5c5dde26 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.34.1")] +[assembly: AssemblyVersion("3.2.34.2")] From 93676f683815c4f132b3d5c3a714ee08c2b01216 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 28 Oct 2017 23:52:05 -0400 Subject: [PATCH 9/9] revise unknown audio stream handling --- Emby.Server.Implementations/Networking/NetworkManager.cs | 8 ++------ MediaBrowser.Model/Dlna/StreamBuilder.cs | 9 --------- MediaBrowser.Providers/Manager/ProviderManager.cs | 3 ++- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/Emby.Server.Implementations/Networking/NetworkManager.cs b/Emby.Server.Implementations/Networking/NetworkManager.cs index 7664ed4423..72d0154aa5 100644 --- a/Emby.Server.Implementations/Networking/NetworkManager.cs +++ b/Emby.Server.Implementations/Networking/NetworkManager.cs @@ -106,6 +106,7 @@ namespace Emby.Server.Implementations.Networking endpoint.StartsWith("127.", StringComparison.OrdinalIgnoreCase) || endpoint.StartsWith("192.168", StringComparison.OrdinalIgnoreCase) || endpoint.StartsWith("169.", StringComparison.OrdinalIgnoreCase) || + endpoint.StartsWith("10.", StringComparison.OrdinalIgnoreCase) || IsInPrivateAddressSpaceAndLocalSubnet(endpoint); } @@ -113,12 +114,7 @@ namespace Emby.Server.Implementations.Networking { var endpointFirstPart = endpoint.Split('.')[0]; - if ( - endpoint.StartsWith("127.", StringComparison.OrdinalIgnoreCase) || - endpoint.StartsWith("10.", StringComparison.OrdinalIgnoreCase) || - endpoint.StartsWith("192.168", StringComparison.OrdinalIgnoreCase) || - endpoint.StartsWith("169.", StringComparison.OrdinalIgnoreCase) - ) + if (endpoint.StartsWith("10.", StringComparison.OrdinalIgnoreCase)) { var subnets = GetSubnets(endpointFirstPart); diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index a11c886974..20de247a6a 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -1099,15 +1099,6 @@ namespace MediaBrowser.Model.Dlna { string audioCodec = audioStream.Codec; - if (string.IsNullOrEmpty(audioCodec)) - { - _logger.Info("Profile: {0}, DirectPlay=false. Reason=Unknown audio codec. Path: {1}", - profile.Name ?? "Unknown Profile", - mediaSource.Path ?? "Unknown path"); - - return new Tuple>(null, new List { TranscodeReason.UnknownAudioStreamInfo }); - } - conditions = new List(); bool? isSecondaryAudio = audioStream == null ? null : mediaSource.IsSecondaryAudio(audioStream); diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.cs index 9dd5052dae..cdef42771a 100644 --- a/MediaBrowser.Providers/Manager/ProviderManager.cs +++ b/MediaBrowser.Providers/Manager/ProviderManager.cs @@ -948,7 +948,8 @@ namespace MediaBrowser.Providers.Manager } else { - throw new Exception(string.Format("Refresh for item {0} {1} is not in progress", item.GetType().Name, item.Id.ToString("N"))); + // TODO: Need to hunt down the conditions for this happening + //throw new Exception(string.Format("Refresh for item {0} {1} is not in progress", item.GetType().Name, item.Id.ToString("N"))); } } }