mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Hook new registration load to changing supporter keys
This commit is contained in:
parent
d3b37a73cc
commit
a7f06c84b1
@ -73,9 +73,9 @@ namespace MediaBrowser.Common.Implementations.Security
|
||||
{
|
||||
var tasks = new List<Task>();
|
||||
|
||||
ResetSupporterInfo();
|
||||
tasks.AddRange(_registeredEntities.Select(i => i.LoadRegistrationInfoAsync()));
|
||||
await Task.WhenAll(tasks);
|
||||
ResetSupporterInfo();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -101,11 +101,8 @@ namespace MediaBrowser.Common.Implementations.Security
|
||||
if (value != MBRegistration.SupporterKey)
|
||||
{
|
||||
MBRegistration.SupporterKey = value;
|
||||
// Clear this so it will re-evaluate
|
||||
ResetSupporterInfo();
|
||||
// And we'll need to restart to re-evaluate the status of plug-ins
|
||||
_appHost.NotifyPendingRestart();
|
||||
|
||||
// re-load registration info
|
||||
Task.Run(() => LoadAllRegistrationInfo());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -118,10 +115,13 @@ namespace MediaBrowser.Common.Implementations.Security
|
||||
{
|
||||
get { return MBRegistration.LegacyKey; }
|
||||
set
|
||||
{
|
||||
if (value != MBRegistration.LegacyKey)
|
||||
{
|
||||
MBRegistration.LegacyKey = value;
|
||||
// And we'll need to restart to re-evaluate the status of plug-ins
|
||||
_appHost.NotifyPendingRestart();
|
||||
// re-load registration info
|
||||
Task.Run(() => LoadAllRegistrationInfo());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,12 @@ namespace MediaBrowser.Common.Security
|
||||
{
|
||||
public interface IRequiresRegistration
|
||||
{
|
||||
/// <summary>
|
||||
/// Load all registration information required for this entity.
|
||||
/// Your class should re-load all MBRegistrationRecords when this is called even if they were
|
||||
/// previously loaded.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task LoadRegistrationInfoAsync();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user