diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index f4e1d84ac6..42bda3d32a 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Updates; using MediaBrowser.Model.Weather; using ProtoBuf; using System; diff --git a/MediaBrowser.Model/Entities/IByReferenceItem.cs b/MediaBrowser.Model/Entities/IByReferenceItem.cs index 7554ad36de..70f743d905 100644 --- a/MediaBrowser.Model/Entities/IByReferenceItem.cs +++ b/MediaBrowser.Model/Entities/IByReferenceItem.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - + namespace MediaBrowser.Model.Entities { /// diff --git a/MediaBrowser.Model/Entities/ImageDownloadOptions.cs b/MediaBrowser.Model/Entities/ImageDownloadOptions.cs index 38d4427053..b5c3ee3923 100644 --- a/MediaBrowser.Model/Entities/ImageDownloadOptions.cs +++ b/MediaBrowser.Model/Entities/ImageDownloadOptions.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using ProtoBuf; +using ProtoBuf; namespace MediaBrowser.Model.Entities { diff --git a/MediaBrowser.Model/Querying/ItemsByNameQuery.cs b/MediaBrowser.Model/Querying/ItemsByNameQuery.cs index 35964aea3d..0bebb085e1 100644 --- a/MediaBrowser.Model/Querying/ItemsByNameQuery.cs +++ b/MediaBrowser.Model/Querying/ItemsByNameQuery.cs @@ -24,7 +24,7 @@ namespace MediaBrowser.Model.Querying /// The size of the page. public int? Limit { get; set; } /// - /// Gets or sets a value indicating whether this is recursive. + /// Gets or sets a value indicating whether this is recursive. /// /// true if recursive; otherwise, false. public bool Recursive { get; set; } diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs index d5b8b38c59..8e715e47cd 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -598,7 +598,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer /// /// The has options. /// The response headers. - private void AddResponseHeaders(IHasOptions hasOptions, IDictionary responseHeaders) + private void AddResponseHeaders(IHasOptions hasOptions, IEnumerable> responseHeaders) { foreach (var item in responseHeaders) { diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs index 2eea8ff754..b1402eec75 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs @@ -3,7 +3,6 @@ using MediaBrowser.Common; using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Net; using MediaBrowser.Model.Logging; -using MediaBrowser.Model.Serialization; using ServiceStack.Api.Swagger; using ServiceStack.Common.Web; using ServiceStack.Configuration; diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index a21b3e93ef..e6c67d6c96 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -1,7 +1,6 @@ using MediaBrowser.Common.Events; using MediaBrowser.Common.Extensions; using MediaBrowser.Common.ScheduledTasks; -using MediaBrowser.Controller; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Movies; @@ -76,7 +75,7 @@ namespace MediaBrowser.Server.Implementations.Library public event EventHandler LibraryChanged; /// - /// Raises the event. + /// Reports the library changed. /// /// The instance containing the event data. public void ReportLibraryChanged(ChildrenChangedEventArgs args) @@ -753,7 +752,7 @@ namespace MediaBrowser.Server.Implementations.Library await RootFolder.RefreshMetadata(cancellationToken).ConfigureAwait(false); // Start by just validating the children of the root, but go no further - await RootFolder.ValidateChildren(new Progress { }, cancellationToken, recursive: false); + await RootFolder.ValidateChildren(new Progress(), cancellationToken, recursive: false); foreach (var folder in _userManager.Users.Select(u => u.RootFolder).Distinct()) { @@ -777,7 +776,7 @@ namespace MediaBrowser.Server.Implementations.Library cancellationToken.ThrowIfCancellationRequested(); - await userRootFolder.ValidateChildren(new Progress { }, cancellationToken, recursive: false).ConfigureAwait(false); + await userRootFolder.ValidateChildren(new Progress(), cancellationToken, recursive: false).ConfigureAwait(false); } /// diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs index 9f78819863..b3bb5683c7 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs @@ -84,6 +84,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV /// Sets the provider id from path. /// /// The item. + /// The path. private void SetProviderIdFromPath(Series item, string path) { var justName = Path.GetFileName(path); diff --git a/MediaBrowser.Server.Implementations/Library/UserManager.cs b/MediaBrowser.Server.Implementations/Library/UserManager.cs index f6d20aa539..311a31264f 100644 --- a/MediaBrowser.Server.Implementations/Library/UserManager.cs +++ b/MediaBrowser.Server.Implementations/Library/UserManager.cs @@ -1,6 +1,5 @@ using MediaBrowser.Common.Events; using MediaBrowser.Common.Extensions; -using MediaBrowser.Controller; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; diff --git a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs index 1fd7e213ad..32c18822f9 100644 --- a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs +++ b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs @@ -298,7 +298,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder /// Unrecognized InputType public string GetInputArgument(string[] inputFiles, InputType type) { - string inputPath = null; + string inputPath; switch (type) { @@ -439,7 +439,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder { var lines = standardError.Split('\n').Select(l => l.TrimStart()); - var chapters = new List { }; + var chapters = new List(); ChapterInfo lastChapter = null; diff --git a/MediaBrowser.Server.Implementations/Providers/ProviderManager.cs b/MediaBrowser.Server.Implementations/Providers/ProviderManager.cs index b08f2eb513..8b135db5a7 100644 --- a/MediaBrowser.Server.Implementations/Providers/ProviderManager.cs +++ b/MediaBrowser.Server.Implementations/Providers/ProviderManager.cs @@ -1,7 +1,6 @@ using MediaBrowser.Common.Extensions; using MediaBrowser.Common.IO; using MediaBrowser.Common.Net; -using MediaBrowser.Controller; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.IO; @@ -86,10 +85,7 @@ namespace MediaBrowser.Server.Implementations.Providers void configurationManager_ConfigurationUpdated(object sender, EventArgs e) { // Validate currently executing providers, in the background - Task.Run(() => - { - ValidateCurrentlyRunningProviders(); - }); + Task.Run(() => ValidateCurrentlyRunningProviders()); } /// diff --git a/MediaBrowser.Server.Implementations/ScheduledTasks/ImageCleanupTask.cs b/MediaBrowser.Server.Implementations/ScheduledTasks/ImageCleanupTask.cs index b20630edb7..e5f6784a41 100644 --- a/MediaBrowser.Server.Implementations/ScheduledTasks/ImageCleanupTask.cs +++ b/MediaBrowser.Server.Implementations/ScheduledTasks/ImageCleanupTask.cs @@ -139,7 +139,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks /// IEnumerable{System.String}. private IEnumerable GetPathsInUse(BaseItem item) { - IEnumerable images = new List { }; + IEnumerable images = new List(); if (item.Images != null) { diff --git a/MediaBrowser.Server.Implementations/ScheduledTasks/PluginUpdateTask.cs b/MediaBrowser.Server.Implementations/ScheduledTasks/PluginUpdateTask.cs index 42e7fea018..9c869ddc18 100644 --- a/MediaBrowser.Server.Implementations/ScheduledTasks/PluginUpdateTask.cs +++ b/MediaBrowser.Server.Implementations/ScheduledTasks/PluginUpdateTask.cs @@ -17,25 +17,20 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks /// public class PluginUpdateTask : IScheduledTask { - /// - /// The _kernel - /// - private readonly Kernel _kernel; /// /// The _logger /// private readonly ILogger _logger; - private IInstallationManager _installationManager; + private readonly IInstallationManager _installationManager; /// /// Initializes a new instance of the class. /// - /// The kernel. /// The logger. - public PluginUpdateTask(Kernel kernel, ILogger logger, IInstallationManager installationManager) + /// The installation manager. + public PluginUpdateTask(ILogger logger, IInstallationManager installationManager) { - _kernel = kernel; _logger = logger; _installationManager = installationManager; } @@ -78,7 +73,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks try { - await _installationManager.InstallPackage(i, new Progress { }, cancellationToken).ConfigureAwait(false); + await _installationManager.InstallPackage(i, new Progress(), cancellationToken).ConfigureAwait(false); } catch (OperationCanceledException) { diff --git a/MediaBrowser.Server.Implementations/ServerManager/ServerManager.cs b/MediaBrowser.Server.Implementations/ServerManager/ServerManager.cs index 991ac2e3b5..2131d90110 100644 --- a/MediaBrowser.Server.Implementations/ServerManager/ServerManager.cs +++ b/MediaBrowser.Server.Implementations/ServerManager/ServerManager.cs @@ -32,12 +32,6 @@ namespace MediaBrowser.Server.Implementations.ServerManager /// The json serializer. private readonly IJsonSerializer _jsonSerializer; - /// - /// This subscribes to HttpListener requests and finds the appropriate BaseHandler to process it - /// - /// The HTTP listener. - private IDisposable HttpListener { get; set; } - /// /// The web socket connections /// @@ -313,11 +307,6 @@ namespace MediaBrowser.Server.Implementations.ServerManager HttpServer.Dispose(); } - if (HttpListener != null) - { - HttpListener.Dispose(); - } - DisposeExternalWebSocketServer(); } diff --git a/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.cs b/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.cs index 7c5d4cdca8..467628a78f 100644 --- a/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.cs +++ b/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.cs @@ -4,7 +4,6 @@ using MediaBrowser.Controller.Persistence; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Serialization; using System; -using System.Collections.Generic; using System.Data; using System.IO; using System.Threading; diff --git a/MediaBrowser.Server.Implementations/Udp/UdpServer.cs b/MediaBrowser.Server.Implementations/Udp/UdpServer.cs index 718a25a0d6..17f5b7b15c 100644 --- a/MediaBrowser.Server.Implementations/Udp/UdpServer.cs +++ b/MediaBrowser.Server.Implementations/Udp/UdpServer.cs @@ -25,12 +25,13 @@ namespace MediaBrowser.Server.Implementations.Udp private readonly INetworkManager _networkManager; private readonly IServerConfigurationManager _serverConfigurationManager; - + /// /// Initializes a new instance of the class. /// /// The logger. /// The network manager. + /// The server configuration manager. public UdpServer(ILogger logger, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager) { _logger = logger; @@ -41,10 +42,10 @@ namespace MediaBrowser.Server.Implementations.Udp /// /// Raises the event. /// - /// The instance containing the event data. + /// The instance containing the event data. private async void OnMessageReceived(UdpMessageReceivedEventArgs e) { - var context = "Server"; + const string context = "Server"; var expectedMessage = String.Format("who is MediaBrowser{0}?", context); var expectedMessageBytes = Encoding.UTF8.GetBytes(expectedMessage); diff --git a/MediaBrowser.Server.Implementations/Updates/InstallationManager.cs b/MediaBrowser.Server.Implementations/Updates/InstallationManager.cs index 347e378feb..7e5b294d60 100644 --- a/MediaBrowser.Server.Implementations/Updates/InstallationManager.cs +++ b/MediaBrowser.Server.Implementations/Updates/InstallationManager.cs @@ -335,7 +335,7 @@ namespace MediaBrowser.Server.Implementations.Updates CurrentInstallations.Add(tuple); } - var innerProgress = new ActionableProgress { }; + var innerProgress = new ActionableProgress(); // Whenever the progress updates, update the outer progress object and InstallationInfo innerProgress.RegisterAction(percent => @@ -347,7 +347,7 @@ namespace MediaBrowser.Server.Implementations.Updates var linkedToken = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, innerCancellationTokenSource.Token).Token; - EventHelper.QueueEventIfNotNull(PackageInstalling, this, new GenericEventArgs() { Argument = installationInfo }, _logger); + EventHelper.QueueEventIfNotNull(PackageInstalling, this, new GenericEventArgs { Argument = installationInfo }, _logger); try { @@ -360,7 +360,7 @@ namespace MediaBrowser.Server.Implementations.Updates CompletedInstallations.Add(installationInfo); - EventHelper.QueueEventIfNotNull(PackageInstallationCompleted, this, new GenericEventArgs() { Argument = installationInfo }, _logger); + EventHelper.QueueEventIfNotNull(PackageInstallationCompleted, this, new GenericEventArgs { Argument = installationInfo }, _logger); } catch (OperationCanceledException) { @@ -371,7 +371,7 @@ namespace MediaBrowser.Server.Implementations.Updates _logger.Info("Package installation cancelled: {0} {1}", package.name, package.versionStr); - EventHelper.QueueEventIfNotNull(PackageInstallationCancelled, this, new GenericEventArgs() { Argument = installationInfo }, _logger); + EventHelper.QueueEventIfNotNull(PackageInstallationCancelled, this, new GenericEventArgs { Argument = installationInfo }, _logger); throw; } @@ -384,7 +384,7 @@ namespace MediaBrowser.Server.Implementations.Updates CurrentInstallations.Remove(tuple); } - EventHelper.QueueEventIfNotNull(PackageInstallationFailed, this, new GenericEventArgs() { Argument = installationInfo }, _logger); + EventHelper.QueueEventIfNotNull(PackageInstallationFailed, this, new GenericEventArgs { Argument = installationInfo }, _logger); throw; } diff --git a/MediaBrowser.Server.Implementations/WorldWeatherOnline/WeatherProvider.cs b/MediaBrowser.Server.Implementations/WorldWeatherOnline/WeatherProvider.cs index 195bfeee3b..9f6ece1757 100644 --- a/MediaBrowser.Server.Implementations/WorldWeatherOnline/WeatherProvider.cs +++ b/MediaBrowser.Server.Implementations/WorldWeatherOnline/WeatherProvider.cs @@ -33,11 +33,12 @@ namespace MediaBrowser.Server.Implementations.WorldWeatherOnline /// The _HTTP client /// private IHttpClient HttpClient { get; set; } - + /// /// Initializes a new instance of the class. /// /// The json serializer. + /// The HTTP client. /// The logger. /// logger public WeatherProvider(IJsonSerializer jsonSerializer, IHttpClient httpClient, ILogger logger)