aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Startup.Common
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Startup.Common')
-rw-r--r--MediaBrowser.Server.Startup.Common/ApplicationHost.cs21
-rw-r--r--MediaBrowser.Server.Startup.Common/INativeApp.cs100
-rw-r--r--MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj2
-rw-r--r--MediaBrowser.Server.Startup.Common/NativeEnvironment.cs19
4 files changed, 6 insertions, 136 deletions
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
index f427f9f567..87bbc48dbd 100644
--- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
+++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
@@ -277,8 +277,9 @@ namespace MediaBrowser.Server.Startup.Common
IFileSystem fileSystem,
INativeApp nativeApp,
IPowerManagement powerManagement,
- string releaseAssetFilename)
- : base(applicationPaths, logManager, fileSystem)
+ string releaseAssetFilename,
+ IEnvironmentInfo environmentInfo)
+ : base(applicationPaths, logManager, fileSystem, environmentInfo)
{
_startupOptions = options;
_releaseAssetFilename = releaseAssetFilename;
@@ -301,11 +302,6 @@ namespace MediaBrowser.Server.Startup.Common
}
}
- public override string OperatingSystemDisplayName
- {
- get { return NativeApp.Environment.OperatingSystemVersionString; }
- }
-
public override bool IsRunningAsService
{
get { return NativeApp.IsRunningAsService; }
@@ -316,11 +312,6 @@ namespace MediaBrowser.Server.Startup.Common
get { return NativeApp.SupportsRunningAsService; }
}
- public bool SupportsLibraryMonitor
- {
- get { return NativeApp.SupportsLibraryMonitor; }
- }
-
/// <summary>
/// Gets the name.
/// </summary>
@@ -1300,7 +1291,7 @@ namespace MediaBrowser.Server.Startup.Common
HttpServerPortNumber = HttpPort,
SupportsHttps = SupportsHttps,
HttpsPortNumber = HttpsPort,
- OperatingSystem = NativeApp.Environment.OperatingSystem.ToString(),
+ OperatingSystem = EnvironmentInfo.OperatingSystem.ToString(),
OperatingSystemDisplayName = OperatingSystemDisplayName,
CanSelfRestart = CanSelfRestart,
CanSelfUpdate = CanSelfUpdate,
@@ -1312,9 +1303,9 @@ namespace MediaBrowser.Server.Startup.Common
SupportsRunningAsService = SupportsRunningAsService,
ServerName = FriendlyName,
LocalAddress = localAddress,
- SupportsLibraryMonitor = SupportsLibraryMonitor,
+ SupportsLibraryMonitor = true,
EncoderLocationType = MediaEncoder.EncoderLocationType,
- SystemArchitecture = NativeApp.Environment.SystemArchitecture,
+ SystemArchitecture = EnvironmentInfo.SystemArchitecture,
SystemUpdateLevel = ConfigurationManager.CommonConfiguration.SystemUpdateLevel,
PackageName = _startupOptions.GetOption("-package")
};
diff --git a/MediaBrowser.Server.Startup.Common/INativeApp.cs b/MediaBrowser.Server.Startup.Common/INativeApp.cs
deleted file mode 100644
index 182afbf003..0000000000
--- a/MediaBrowser.Server.Startup.Common/INativeApp.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-using MediaBrowser.Common.Net;
-using MediaBrowser.Model.Logging;
-using System.Collections.Generic;
-using System.Reflection;
-using Emby.Server.Core;
-using Emby.Server.Core.Data;
-using Emby.Server.Core.FFMpeg;
-
-namespace MediaBrowser.Server.Startup.Common
-{
- public interface INativeApp
- {
- /// <summary>
- /// Gets the assemblies with parts.
- /// </summary>
- /// <returns>List&lt;Assembly&gt;.</returns>
- List<Assembly> GetAssembliesWithParts();
-
- /// <summary>
- /// Authorizes the server.
- /// </summary>
- /// <param name="udpPort">The UDP port.</param>
- /// <param name="httpServerPort">The HTTP server port.</param>
- /// <param name="httpsServerPort">The HTTPS server port.</param>
- /// <param name="tempDirectory">The temporary directory.</param>
- void AuthorizeServer(int udpPort, int httpServerPort, int httpsServerPort, string applicationPath, string tempDirectory);
-
- /// <summary>
- /// Gets the environment.
- /// </summary>
- /// <value>The environment.</value>
- NativeEnvironment Environment { get; }
-
- /// <summary>
- /// Gets a value indicating whether [supports running as service].
- /// </summary>
- /// <value><c>true</c> if [supports running as service]; otherwise, <c>false</c>.</value>
- bool SupportsRunningAsService { get; }
-
- /// <summary>
- /// Gets a value indicating whether this instance is running as service.
- /// </summary>
- /// <value><c>true</c> if this instance is running as service; otherwise, <c>false</c>.</value>
- bool IsRunningAsService { get; }
-
- /// <summary>
- /// Gets a value indicating whether this instance can self restart.
- /// </summary>
- /// <value><c>true</c> if this instance can self restart; otherwise, <c>false</c>.</value>
- bool CanSelfRestart { get; }
-
- /// <summary>
- /// Gets a value indicating whether [supports autorun at startup].
- /// </summary>
- /// <value><c>true</c> if [supports autorun at startup]; otherwise, <c>false</c>.</value>
- bool SupportsAutoRunAtStartup { get; }
-
- /// <summary>
- /// Gets a value indicating whether [supports library monitor].
- /// </summary>
- /// <value><c>true</c> if [supports library monitor]; otherwise, <c>false</c>.</value>
- bool SupportsLibraryMonitor { get; }
-
- /// <summary>
- /// Gets a value indicating whether this instance can self update.
- /// </summary>
- /// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
- bool CanSelfUpdate { get; }
-
- /// <summary>
- /// Shutdowns this instance.
- /// </summary>
- void Shutdown();
-
- /// <summary>
- /// Restarts this instance.
- /// </summary>
- void Restart(StartupOptions startupOptions);
-
- /// <summary>
- /// Configures the automatic run.
- /// </summary>
- /// <param name="autorun">if set to <c>true</c> [autorun].</param>
- void ConfigureAutoRun(bool autorun);
-
- /// <summary>
- /// Gets the network manager.
- /// </summary>
- /// <returns>INetworkManager.</returns>
- INetworkManager CreateNetworkManager(ILogger logger);
-
- FFMpegInstallInfo GetFfmpegInstallInfo();
-
- void LaunchUrl(string url);
-
- IDbConnector GetDbConnector();
-
- void EnableLoopback(string appName);
- }
-}
diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
index 3b391b236c..ff7456977b 100644
--- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
+++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
@@ -114,7 +114,6 @@
<Compile Include="Cryptography\X509Extensions.cs" />
<Compile Include="Cryptography\X520Attributes.cs" />
<Compile Include="HttpServerFactory.cs" />
- <Compile Include="INativeApp.cs" />
<Compile Include="IO\MemoryStreamProvider.cs" />
<Compile Include="LiveTv\TunerHosts\SatIp\ChannelScan.cs" />
<Compile Include="LiveTv\TunerHosts\SatIp\Rtcp\ReportBlock.cs" />
@@ -138,7 +137,6 @@
<Compile Include="LiveTv\TunerHosts\SatIp\SatIpHost.cs" />
<Compile Include="LiveTv\TunerHosts\SatIp\TransmissionMode.cs" />
<Compile Include="LiveTv\TunerHosts\SatIp\Utils.cs" />
- <Compile Include="NativeEnvironment.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SystemEvents.cs" />
</ItemGroup>
diff --git a/MediaBrowser.Server.Startup.Common/NativeEnvironment.cs b/MediaBrowser.Server.Startup.Common/NativeEnvironment.cs
deleted file mode 100644
index b30509982e..0000000000
--- a/MediaBrowser.Server.Startup.Common/NativeEnvironment.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using MediaBrowser.Model.System;
-
-namespace MediaBrowser.Server.Startup.Common
-{
- public class NativeEnvironment
- {
- public OperatingSystem OperatingSystem { get; set; }
- public Architecture SystemArchitecture { get; set; }
- public string OperatingSystemVersionString { get; set; }
- }
-
- public enum OperatingSystem
- {
- Windows = 0,
- Osx = 1,
- Bsd = 2,
- Linux = 3
- }
-}