mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-02 16:32:07 +01:00
chromecast updates
This commit is contained in:
@@ -554,9 +554,9 @@ namespace MediaBrowser.ServerApplication
|
||||
SetKernelProperties();
|
||||
}
|
||||
|
||||
protected override INetworkManager CreateNetworkManager()
|
||||
protected override INetworkManager CreateNetworkManager(ILogger logger)
|
||||
{
|
||||
return new NetworkManager();
|
||||
return new NetworkManager(logger);
|
||||
}
|
||||
|
||||
protected override IFileSystem CreateFileSystemManager()
|
||||
@@ -958,10 +958,39 @@ namespace MediaBrowser.ServerApplication
|
||||
SupportsAutoRunAtStartup = SupportsAutoRunAtStartup,
|
||||
TranscodingTempPath = ApplicationPaths.TranscodingTempPath,
|
||||
IsRunningAsService = IsRunningAsService,
|
||||
ServerName = FriendlyName
|
||||
ServerName = FriendlyName,
|
||||
LocalAddress = GetLocalIpAddress()
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the local ip address.
|
||||
/// </summary>
|
||||
/// <returns>System.String.</returns>
|
||||
private string GetLocalIpAddress()
|
||||
{
|
||||
var localAddresses = NetworkManager.GetLocalIpAddresses().ToList();
|
||||
|
||||
// Cross-check the local ip addresses with addresses that have been received on with the http server
|
||||
var matchedAddress = HttpServer.LocalEndPoints
|
||||
.ToList()
|
||||
.Select(i => i.Split(':').FirstOrDefault())
|
||||
.Where(i => !string.IsNullOrEmpty(i))
|
||||
.FirstOrDefault(i => localAddresses.Contains(i, StringComparer.OrdinalIgnoreCase));
|
||||
|
||||
// Return the first matched address, if found, or the first known local address
|
||||
var address = matchedAddress ?? localAddresses.FirstOrDefault();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(address))
|
||||
{
|
||||
address = string.Format("http://{0}:{1}",
|
||||
address,
|
||||
ServerConfigurationManager.Configuration.HttpServerPortNumber.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
return address;
|
||||
}
|
||||
|
||||
public string FriendlyName
|
||||
{
|
||||
get
|
||||
|
||||
@@ -61,14 +61,14 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="MediaBrowser.IsoMounter">
|
||||
<HintPath>..\packages\MediaBrowser.IsoMounting.3.0.68\lib\net45\MediaBrowser.IsoMounter.dll</HintPath>
|
||||
<HintPath>..\packages\MediaBrowser.IsoMounting.3.0.69\lib\net45\MediaBrowser.IsoMounter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=3.1.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\NLog.3.1.0.0\lib\net45\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="pfmclrapi">
|
||||
<HintPath>..\packages\MediaBrowser.IsoMounting.3.0.68\lib\net45\pfmclrapi.dll</HintPath>
|
||||
<HintPath>..\packages\MediaBrowser.IsoMounting.3.0.69\lib\net45\pfmclrapi.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ServiceStack.Interfaces">
|
||||
<HintPath>..\ThirdParty\ServiceStack\ServiceStack.Interfaces.dll</HintPath>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
using MediaBrowser.Common.Implementations.Networking;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace MediaBrowser.ServerApplication.Networking
|
||||
@@ -17,6 +17,11 @@ namespace MediaBrowser.ServerApplication.Networking
|
||||
/// </summary>
|
||||
public class NetworkManager : BaseNetworkManager, INetworkManager
|
||||
{
|
||||
public NetworkManager(ILogger logger)
|
||||
: base(logger)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the network shares.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MediaBrowser.IsoMounting" version="3.0.68" targetFramework="net45" />
|
||||
<package id="MediaBrowser.IsoMounting" version="3.0.69" targetFramework="net45" />
|
||||
<package id="NLog" version="3.1.0.0" targetFramework="net45" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user