IServerApplicationHost.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Net;
  4. using System.Threading;
  5. using System.Threading.Tasks;
  6. using MediaBrowser.Common;
  7. using MediaBrowser.Model.System;
  8. using Microsoft.AspNetCore.Http;
  9. namespace MediaBrowser.Controller
  10. {
  11. /// <summary>
  12. /// Interface IServerApplicationHost
  13. /// </summary>
  14. public interface IServerApplicationHost : IApplicationHost
  15. {
  16. event EventHandler HasUpdateAvailableChanged;
  17. /// <summary>
  18. /// Gets a value indicating whether the server is hosting the static web content from jellyfin-web.
  19. /// </summary>
  20. bool IsHostingContent { get; }
  21. /// <summary>
  22. /// Gets the system info.
  23. /// </summary>
  24. /// <returns>SystemInfo.</returns>
  25. Task<SystemInfo> GetSystemInfo(CancellationToken cancellationToken);
  26. Task<PublicSystemInfo> GetPublicSystemInfo(CancellationToken cancellationToken);
  27. bool CanLaunchWebBrowser { get; }
  28. /// <summary>
  29. /// Gets the HTTP server port.
  30. /// </summary>
  31. /// <value>The HTTP server port.</value>
  32. int HttpPort { get; }
  33. /// <summary>
  34. /// Gets the HTTPS port.
  35. /// </summary>
  36. /// <value>The HTTPS port.</value>
  37. int HttpsPort { get; }
  38. /// <summary>
  39. /// Gets a value indicating whether [supports HTTPS].
  40. /// </summary>
  41. /// <value><c>true</c> if [supports HTTPS]; otherwise, <c>false</c>.</value>
  42. bool EnableHttps { get; }
  43. /// <summary>
  44. /// Gets a value indicating whether this instance has update available.
  45. /// </summary>
  46. /// <value><c>true</c> if this instance has update available; otherwise, <c>false</c>.</value>
  47. bool HasUpdateAvailable { get; }
  48. /// <summary>
  49. /// Gets the name of the friendly.
  50. /// </summary>
  51. /// <value>The name of the friendly.</value>
  52. string FriendlyName { get; }
  53. /// <summary>
  54. /// Gets the local ip address.
  55. /// </summary>
  56. /// <value>The local ip address.</value>
  57. Task<List<IPAddress>> GetLocalIpAddresses(CancellationToken cancellationToken);
  58. /// <summary>
  59. /// Gets the local API URL.
  60. /// </summary>
  61. /// <value>The local API URL.</value>
  62. Task<string> GetLocalApiUrl(CancellationToken cancellationToken);
  63. /// <summary>
  64. /// Gets the local API URL.
  65. /// </summary>
  66. /// <param name="hostname">The hostname.</param>
  67. /// <returns>The local API URL.</returns>
  68. string GetLocalApiUrl(ReadOnlySpan<char> hostname);
  69. /// <summary>
  70. /// Gets the local API URL.
  71. /// </summary>
  72. /// <param name="address">The IP address.</param>
  73. /// <returns>The local API URL.</returns>
  74. string GetLocalApiUrl(IPAddress address);
  75. void LaunchUrl(string url);
  76. void EnableLoopback(string appName);
  77. IEnumerable<WakeOnLanInfo> GetWakeOnLanInfo();
  78. string ExpandVirtualPath(string path);
  79. string ReverseVirtualPath(string path);
  80. Task ExecuteHttpHandlerAsync(HttpContext context, Func<Task> next);
  81. Task ExecuteWebsocketHandlerAsync(HttpContext context, Func<Task> next);
  82. }
  83. }