CoreAppHost.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 Microsoft.Extensions.Configuration;
  7. using Microsoft.Extensions.Logging;
  8. namespace Jellyfin.Server
  9. {
  10. public class CoreAppHost : ApplicationHost
  11. {
  12. public CoreAppHost(
  13. ServerApplicationPaths applicationPaths,
  14. ILoggerFactory loggerFactory,
  15. StartupOptions options,
  16. IFileSystem fileSystem,
  17. MediaBrowser.Controller.Drawing.IImageEncoder imageEncoder,
  18. MediaBrowser.Common.Net.INetworkManager networkManager,
  19. IConfiguration configuration)
  20. : base(
  21. applicationPaths,
  22. loggerFactory,
  23. options,
  24. fileSystem,
  25. imageEncoder,
  26. networkManager,
  27. configuration)
  28. {
  29. }
  30. public override bool CanSelfRestart => StartupOptions.RestartPath != null;
  31. protected override void RestartInternal() => Program.Restart();
  32. protected override IEnumerable<Assembly> GetAssembliesWithPartsInternal()
  33. {
  34. yield return typeof(CoreAppHost).Assembly;
  35. }
  36. protected override void ShutdownInternal() => Program.Shutdown();
  37. }
  38. }