The Free Software Media System - Server Backend & API
Updatig netcollection & re-inserting BOM
Jim Cartlidge53af1e345539
diff --git a/Emby.Dlna/Main/DlnaEntryPoint.cs b/Emby.Dlna/Main/DlnaEntryPoint.csindex 33a953563b..a644d2c8cc 100644--- a/Emby.Dlna/Main/DlnaEntryPoint.cs+++ b/Emby.Dlna/Main/DlnaEntryPoint.cs@@ -271,33 +271,33 @@ namespace Emby.Dlna.MainbindAddresses = _networkManager.GetLoopbacks();}- foreach (var addr in bindAddresses)+ foreach (IPNetAddress address in bindAddresses){- if (addr.AddressFamily == AddressFamily.InterNetworkV6)+ if (address.AddressFamily == AddressFamily.InterNetworkV6){// Not supporting IPv6 right nowcontinue;}// Limit to LAN addresses only- if (!_networkManager.IsInLocalNetwork(addr))+ if (!_networkManager.IsInLocalNetwork(address)){continue;}var fullService = "urn:schemas-upnp-org:device:MediaServer:1";- _logger.LogInformation("Registering publisher for {0} on {1}", fullService, addr);+ _logger.LogInformation("Registering publisher for {0} on {1}", fullService, address);var descriptorUri = "/dlna/" + udn + "/description.xml";- var uri = new Uri(_appHost.GetSmartApiUrl(addr.Address) + descriptorUri);+ var uri = new Uri(_appHost.GetSmartApiUrl(address.Address) + descriptorUri);var device = new SsdpRootDevice{CacheLifetime = TimeSpan.FromSeconds(1800), // How long SSDP clients can cache this info.Location = uri, // Must point to the URL that serves your devices UPnP description document.- Address = addr.Address,- SubnetMask = ((IPNetAddress)addr).Mask, // MIGRATION: This fields is going.+ Address = address.Address,+ SubnetMask = address.Mask,FriendlyName = "Jellyfin",Manufacturer = "Jellyfin",ModelName = "Jellyfin Server",diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.csindex 66e48ddc65..77584e9d0d 100644--- a/Emby.Server.Implementations/ApplicationHost.cs+++ b/Emby.Server.Implementations/ApplicationHost.cs@@ -262,8 +262,8 @@ namespace Emby.Server.ImplementationsIServiceCollection serviceCollection){_xmlSerializer = new MyXmlSerializer();- _jsonSerializer = new JsonSerializer();-+ _jsonSerializer = new JsonSerializer();+ServiceCollection = serviceCollection;ApplicationPaths = applicationPaths;@@ -1079,7 +1079,7 @@ namespace Emby.Server.Implementations{// No metafile, so lets see if the folder is versioned.metafile = dir.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries)[^1];-+int versionIndex = dir.LastIndexOf('_');if (versionIndex != -1 && Version.TryParse(dir.Substring(versionIndex + 1), out Version ver)){@@ -1248,7 +1248,7 @@ namespace Emby.Server.ImplementationsOperatingSystem = OperatingSystem.Id.ToString(),ServerName = FriendlyName,LocalAddress = GetSmartApiUrl(source),- StartupWizardCompleted = ConfigurationManager.CommonConfiguration.IsStartupWizardCompleted+ StartupWizardCompleted = ConfigurationManager.CommonConfiguration.IsStartupWizardCompleted};}diff --git a/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs b/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.csindex 598cf0af7c..3a738fd5d2 100644--- a/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs+++ b/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs@@ -76,7 +76,6 @@ namespace Emby.Server.Implementations.LiveTv}var list = sources.ToList();- var serverUrl = _appHost.GetSmartApiUrl(string.Empty);foreach (var source in list){@@ -103,7 +102,7 @@ namespace Emby.Server.Implementations.LiveTv// Dummy this up so that direct play checks can still runif (string.IsNullOrEmpty(source.Path) && source.Protocol == MediaProtocol.Http){- source.Path = serverUrl;+ source.Path = _appHost.GetSmartApiUrl(string.Empty);}}diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.csindex a8d2a27f78..cfc5278ece 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs@@ -16,6 +16,7 @@ using MediaBrowser.Model.IO;using MediaBrowser.Model.LiveTv;using MediaBrowser.Model.MediaInfo;using Microsoft.Extensions.Logging;+using NetworkCollection.Udp;namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun{@@ -57,7 +58,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerunvar mediaSource = OriginalMediaSource;var uri = new Uri(mediaSource.Path);- var localPort = 50000; // Will return to random after next PR.+ var localPort = UdpHelper.GetRandomUnusedUdpPort();Directory.CreateDirectory(Path.GetDirectoryName(TempFilePath));diff --git a/Emby.Server.Implementations/Udp/UdpServer.cs b/Emby.Server.Implementations/Udp/UdpServer.csindex 3dc34da5cf..4fd7ac0c18 100644--- a/Emby.Server.Implementations/Udp/UdpServer.cs+++ b/Emby.Server.Implementations/Udp/UdpServer.cs@@ -49,7 +49,7 @@ namespace Emby.Server.Implementations.Udp{string localUrl = !string.IsNullOrEmpty(_config[AddressOverrideConfigKey])? _config[AddressOverrideConfigKey]- : _appHost.GetSmartApiUrl(string.Empty); // MIGRATION: Temp value.+ : _appHost.GetSmartApiUrl(((IPEndPoint)endpoint).Address);if (!string.IsNullOrEmpty(localUrl)){diff --git a/Jellyfin.Networking/Jellyfin.Networking.csproj b/Jellyfin.Networking/Jellyfin.Networking.csprojindex 06d387dc87..7f01f149ec 100644--- a/Jellyfin.Networking/Jellyfin.Networking.csproj+++ b/Jellyfin.Networking/Jellyfin.Networking.csproj@@ -28,7 +28,7 @@<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.1.7" /><PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.7" /><PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="3.1.7" />- <PackageReference Include="NetworkCollection" Version="1.0.3" />+ <PackageReference Include="NetworkCollection" Version="1.0.4" /></ItemGroup><ItemGroup>diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.csindex ea9e9a6fb5..8f1f0fa613 100644--- a/RSSDP/SsdpCommunicationsServer.cs+++ b/RSSDP/SsdpCommunicationsServer.cs@@ -352,7 +352,7 @@ namespace Rssdp.Infrastructureif (_enableMultiSocketBinding){- foreach (var address in _networkManager.GetAllBindInterfaces())+ foreach (var address in _networkManager.GetInternalBindAddresses()){if (address.AddressFamily == AddressFamily.InterNetworkV6){diff --git a/RSSDP/SsdpDevicePublisher.cs b/RSSDP/SsdpDevicePublisher.csindex c70294b38e..ca382c905a 100644--- a/RSSDP/SsdpDevicePublisher.cs+++ b/RSSDP/SsdpDevicePublisher.cs@@ -301,9 +301,10 @@ namespace Rssdp.Infrastructureforeach (var device in deviceList){- var ip1 = new IPNetAddress(device.ToRootDevice().Address, device.ToRootDevice().SubnetMask);- var ip2 = new IPNetAddress(remoteEndPoint.Address, device.ToRootDevice().SubnetMask);- if (!_sendOnlyMatchedHost || ip1.NetworkAddress.Equals(ip2.NetworkAddress))+ var root = device.ToRootDevice();+ var source = new IPNetAddress(root.Address, root.SubnetMask);+ var destination = new IPNetAddress(remoteEndPoint.Address, root.SubnetMask);+ if (!_sendOnlyMatchedHost || source.NetworkAddress.Equals(destination.NetworkAddress)){SendDeviceSearchResponses(device, remoteEndPoint, receivedOnlocalIpAddress, cancellationToken);}