EntryPoint.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using MediaBrowser.Common.Configuration;
  2. using MediaBrowser.Common.Security;
  3. using MediaBrowser.Controller.Plugins;
  4. using MediaBrowser.Model.LiveTv;
  5. namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
  6. {
  7. public class EntryPoint : IServerEntryPoint
  8. {
  9. private readonly IConfigurationManager _config;
  10. private readonly ISecurityManager _manager;
  11. public EntryPoint(IConfigurationManager config, ISecurityManager manager)
  12. {
  13. _config = config;
  14. _manager = manager;
  15. }
  16. public async void Run()
  17. {
  18. EmbyTV.Current.Start();
  19. if (GetConfiguration().ListingProviders.Count > 0 || GetConfiguration().TunerHosts.Count > 0)
  20. {
  21. try
  22. {
  23. await _manager.GetRegistrationStatus("livetvguide").ConfigureAwait(false);
  24. }
  25. catch
  26. {
  27. }
  28. }
  29. }
  30. private LiveTvOptions GetConfiguration()
  31. {
  32. return _config.GetConfiguration<LiveTvOptions>("livetv");
  33. }
  34. public void Dispose()
  35. {
  36. }
  37. }
  38. }