aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ApplicationHost.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs84
1 files changed, 3 insertions, 81 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index ef965ec8a..9b9c6146f 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -950,9 +950,6 @@ namespace Emby.Server.Implementations
DeviceManager = new DeviceManager(AuthenticationRepository, JsonSerializer, LibraryManager, LocalizationManager, UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager, LoggerFactory.CreateLogger("DeviceManager"), NetworkManager);
RegisterSingleInstance(DeviceManager);
- var newsService = new Emby.Server.Implementations.News.NewsService(ApplicationPaths, JsonSerializer);
- RegisterSingleInstance<INewsService>(newsService);
-
MediaSourceManager = new MediaSourceManager(ItemRepository, ApplicationPaths, LocalizationManager, UserManager, LibraryManager, LoggerFactory.CreateLogger("MediaSourceManager"), JsonSerializer, FileSystemManager, UserDataManager, TimerFactory, () => MediaEncoder);
RegisterSingleInstance(MediaSourceManager);
@@ -1297,7 +1294,6 @@ namespace Emby.Server.Implementations
{
if (!ServerConfigurationManager.Configuration.IsPortAuthorized)
{
- RegisterServerWithAdministratorAccess();
ServerConfigurationManager.Configuration.IsPortAuthorized = true;
ConfigurationManager.SaveConfiguration();
}
@@ -2211,32 +2207,6 @@ namespace Emby.Server.Implementations
protected abstract void ShutdownInternal();
- /// <summary>
- /// Registers the server with administrator access.
- /// </summary>
- private void RegisterServerWithAdministratorAccess()
- {
- Logger.LogInformation("Requesting administrative access to authorize http server");
-
- try
- {
- AuthorizeServer();
- }
- catch (NotImplementedException)
- {
-
- }
- catch (Exception ex)
- {
- Logger.LogError(ex, "Error authorizing server");
- }
- }
-
- protected virtual void AuthorizeServer()
- {
- throw new NotImplementedException();
- }
-
public event EventHandler HasUpdateAvailableChanged;
private bool _hasUpdateAvailable;
@@ -2251,7 +2221,7 @@ namespace Emby.Server.Implementations
if (fireEvent)
{
- EventHelper.FireEventIfNotNull(HasUpdateAvailableChanged, this, EventArgs.Empty, Logger);
+ HasUpdateAvailableChanged?.Invoke(this, EventArgs.Empty);
}
}
}
@@ -2367,11 +2337,10 @@ namespace Emby.Server.Implementations
{
Logger.LogInformation("Application has been updated to version {0}", package.versionStr);
- EventHelper.FireEventIfNotNull(ApplicationUpdated, this, new GenericEventArgs<PackageVersionInfo>
+ ApplicationUpdated?.Invoke(this, new GenericEventArgs<PackageVersionInfo>
{
Argument = package
-
- }, Logger);
+ });
NotifyPendingRestart();
}
@@ -2420,53 +2389,6 @@ namespace Emby.Server.Implementations
}
}
}
-
- private Dictionary<string, string> _values;
- public string GetValue(string name)
- {
- if (_values == null)
- {
- _values = LoadValues();
- }
-
- string value;
-
- if (_values.TryGetValue(name, out value))
- {
- return value;
- }
-
- return null;
- }
-
- // TODO: @bond Remove?
- private Dictionary<string, string> LoadValues()
- {
- Dictionary<string, string> values = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
-
- using (var stream = typeof(ApplicationHost).Assembly.GetManifestResourceStream(typeof(ApplicationHost).Namespace + ".values.txt"))
- {
- using (var reader = new StreamReader(stream))
- {
- while (!reader.EndOfStream)
- {
- var line = reader.ReadLine();
- if (string.IsNullOrEmpty(line))
- {
- continue;
- }
-
- var index = line.IndexOf('=');
- if (index != -1)
- {
- values[line.Substring(0, index)] = line.Substring(index + 1);
- }
- }
- }
- }
-
- return values;
- }
}
internal class CertificateInfo