CoreAppHost.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System.Collections.Generic;
  2. using System.Reflection;
  3. using Emby.Server.Implementations;
  4. using MediaBrowser.Common.Net;
  5. using MediaBrowser.Controller.Drawing;
  6. using MediaBrowser.Model.IO;
  7. using Microsoft.Extensions.Logging;
  8. namespace Jellyfin.Server
  9. {
  10. /// <summary>
  11. /// Implementation of the abstract <see cref="ApplicationHost" /> class.
  12. /// </summary>
  13. public class CoreAppHost : ApplicationHost
  14. {
  15. /// <summary>
  16. /// Initializes a new instance of the <see cref="CoreAppHost" /> class.
  17. /// </summary>
  18. /// <param name="applicationPaths">The <see cref="ServerApplicationPaths" /> to be used by the <see cref="CoreAppHost" />.</param>
  19. /// <param name="loggerFactory">The <see cref="ILoggerFactory" /> to be used by the <see cref="CoreAppHost" />.</param>
  20. /// <param name="options">The <see cref="StartupOptions" /> to be used by the <see cref="CoreAppHost" />.</param>
  21. /// <param name="fileSystem">The <see cref="IFileSystem" /> to be used by the <see cref="CoreAppHost" />.</param>
  22. /// <param name="imageEncoder">The <see cref="IImageEncoder" /> to be used by the <see cref="CoreAppHost" />.</param>
  23. /// <param name="networkManager">The <see cref="INetworkManager" /> to be used by the <see cref="CoreAppHost" />.</param>
  24. public CoreAppHost(
  25. ServerApplicationPaths applicationPaths,
  26. ILoggerFactory loggerFactory,
  27. StartupOptions options,
  28. IFileSystem fileSystem,
  29. IImageEncoder imageEncoder,
  30. INetworkManager networkManager)
  31. : base(
  32. applicationPaths,
  33. loggerFactory,
  34. options,
  35. fileSystem,
  36. imageEncoder,
  37. networkManager)
  38. {
  39. }
  40. /// <inheritdoc />
  41. public override bool CanSelfRestart => StartupOptions.RestartPath != null;
  42. /// <inheritdoc />
  43. protected override void RestartInternal() => Program.Restart();
  44. /// <inheritdoc />
  45. protected override IEnumerable<Assembly> GetAssembliesWithPartsInternal()
  46. {
  47. yield return typeof(CoreAppHost).Assembly;
  48. }
  49. /// <inheritdoc />
  50. protected override void ShutdownInternal() => Program.Shutdown();
  51. }
  52. }