SyncRegistrationInfo.cs 824 B

12345678910111213141516171819202122232425262728293031
  1. using MediaBrowser.Common.Security;
  2. using System.Threading.Tasks;
  3. namespace MediaBrowser.Server.Implementations.Sync
  4. {
  5. public class SyncRegistrationInfo : IRequiresRegistration
  6. {
  7. private readonly ISecurityManager _securityManager;
  8. public static SyncRegistrationInfo Instance;
  9. public SyncRegistrationInfo(ISecurityManager securityManager)
  10. {
  11. _securityManager = securityManager;
  12. Instance = this;
  13. }
  14. private bool _registered;
  15. public bool IsRegistered
  16. {
  17. get { return _registered; }
  18. }
  19. public async Task LoadRegistrationInfoAsync()
  20. {
  21. var info = await _securityManager.GetRegistrationStatus("sync").ConfigureAwait(false);
  22. _registered = info.IsValid;
  23. }
  24. }
  25. }