mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-05 09:46:17 +00:00
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
This commit is contained in:
@@ -500,14 +500,14 @@ namespace MediaBrowser.Common.Implementations
|
||||
if (ConfigurationManager.CommonConfiguration.RunAtStartup)
|
||||
{
|
||||
//Copy our shortut into the startup folder for this user
|
||||
File.Copy(ProductShortcutPath, Environment.GetFolderPath(Environment.SpecialFolder.Startup), true);
|
||||
File.Copy(ProductShortcutPath, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup),Path.GetFileName(ProductShortcutPath) ?? "MBstartup.lnk"), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Remove our shortcut from the startup folder for this user
|
||||
try
|
||||
{
|
||||
File.Delete(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), Path.GetFileName(ProductShortcutPath)));
|
||||
File.Delete(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), Path.GetFileName(ProductShortcutPath) ?? "MBstartup.lnk"));
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
|
||||
@@ -47,6 +47,13 @@ namespace MediaBrowser.Common.Implementations.Security
|
||||
private IJsonSerializer _jsonSerializer;
|
||||
private IApplicationHost _appHost;
|
||||
private IEnumerable<IRequiresRegistration> _registeredEntities;
|
||||
protected IEnumerable<IRequiresRegistration> RegisteredEntities
|
||||
{
|
||||
get
|
||||
{
|
||||
return _registeredEntities ?? (_registeredEntities = _appHost.GetExports<IRequiresRegistration>());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginSecurityManager" /> class.
|
||||
@@ -61,7 +68,6 @@ namespace MediaBrowser.Common.Implementations.Security
|
||||
_appHost = appHost;
|
||||
_httpClient = httpClient;
|
||||
_jsonSerializer = jsonSerializer;
|
||||
_registeredEntities = _appHost.GetExports<IRequiresRegistration>();
|
||||
MBRegistration.Init(appPaths);
|
||||
}
|
||||
|
||||
@@ -74,7 +80,7 @@ namespace MediaBrowser.Common.Implementations.Security
|
||||
var tasks = new List<Task>();
|
||||
|
||||
ResetSupporterInfo();
|
||||
tasks.AddRange(_registeredEntities.Select(i => i.LoadRegistrationInfoAsync()));
|
||||
tasks.AddRange(RegisteredEntities.Select(i => i.LoadRegistrationInfoAsync()));
|
||||
await Task.WhenAll(tasks);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user