reduce work done by system info endpoints

This commit is contained in:
Luke Pulverenti
2017-12-01 12:03:40 -05:00
parent 5ca1b96c6f
commit d7a1a87009
9 changed files with 38 additions and 38 deletions

View File

@@ -361,7 +361,7 @@ namespace Emby.Server.Implementations
protected IAuthService AuthService { get; private set; }
protected readonly StartupOptions StartupOptions;
public StartupOptions StartupOptions { get; private set; }
protected readonly string ReleaseAssetFilename;
internal IPowerManagement PowerManagement { get; private set; }
@@ -1950,6 +1950,21 @@ namespace Emby.Server.Implementations
};
}
public async Task<PublicSystemInfo> GetPublicSystemInfo(CancellationToken cancellationToken)
{
var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false);
return new PublicSystemInfo
{
Version = ApplicationVersion.ToString(),
Id = SystemId,
OperatingSystem = EnvironmentInfo.OperatingSystem.ToString(),
WanAddress = ConnectManager.WanApiAddress,
ServerName = FriendlyName,
LocalAddress = localAddress
};
}
public bool EnableHttps
{
get