CoreAppHost.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System.Collections.Generic;
  2. using System.Reflection;
  3. using Emby.Server.Implementations;
  4. using Emby.Server.Implementations.HttpServer;
  5. using MediaBrowser.Model.IO;
  6. using MediaBrowser.Model.System;
  7. using Microsoft.Extensions.Configuration;
  8. using Microsoft.Extensions.Logging;
  9. namespace Jellyfin.Server
  10. {
  11. public class CoreAppHost : ApplicationHost
  12. {
  13. public CoreAppHost(
  14. ServerApplicationPaths applicationPaths,
  15. ILoggerFactory loggerFactory,
  16. StartupOptions options,
  17. IFileSystem fileSystem,
  18. IEnvironmentInfo environmentInfo,
  19. MediaBrowser.Controller.Drawing.IImageEncoder imageEncoder,
  20. MediaBrowser.Common.Net.INetworkManager networkManager,
  21. IConfiguration configuration)
  22. : base(
  23. applicationPaths,
  24. loggerFactory,
  25. options,
  26. fileSystem,
  27. environmentInfo,
  28. imageEncoder,
  29. networkManager,
  30. configuration)
  31. {
  32. }
  33. public override bool CanSelfRestart => StartupOptions.RestartPath != null;
  34. protected override void RestartInternal() => Program.Restart();
  35. protected override IEnumerable<Assembly> GetAssembliesWithPartsInternal()
  36. {
  37. yield return typeof(CoreAppHost).Assembly;
  38. }
  39. protected override void ShutdownInternal() => Program.Shutdown();
  40. }
  41. }