From 42ffddc26932bcf2da762bf4fe1ec4bdc42e8166 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Fri, 1 Nov 2019 18:38:54 +0100 Subject: [PATCH 1/2] Fix more warnings --- .../Activity/ActivityLogEntryPoint.cs | 15 +++ .../Activity/ActivityManager.cs | 2 + .../Activity/ActivityRepository.cs | 2 + .../AppBase/BaseConfigurationManager.cs | 21 ++- .../Archiving/ZipClient.cs | 8 +- .../Branding/BrandingConfigurationFactory.cs | 2 + .../Browser/BrowserLauncher.cs | 3 +- .../ChannelDynamicMediaSourceProvider.cs | 8 ++ .../Channels/ChannelImageProvider.cs | 2 + .../Channels/ChannelManager.cs | 2 + .../Channels/ChannelPostScanTask.cs | 2 + .../Channels/RefreshChannelsScheduledTask.cs | 2 + .../Collections/CollectionImageProvider.cs | 2 + .../Collections/CollectionManager.cs | 2 + .../ServerConfigurationManager.cs | 30 ++++- .../Cryptography/CryptographyProvider.cs | 13 ++ .../Data/BaseSqliteRepository.cs | 6 + .../Data/CleanDatabaseScheduledTask.cs | 2 + .../Data/ManagedConnection.cs | 2 + .../SqliteDisplayPreferencesRepository.cs | 2 + .../Data/SqliteExtensions.cs | 2 + .../Data/SqliteUserDataRepository.cs | 2 + .../Data/SqliteUserRepository.cs | 2 + .../Data/TypeMapper.cs | 11 +- .../Devices/DeviceId.cs | 2 + .../Devices/DeviceManager.cs | 2 + .../Diagnostics/CommonProcess.cs | 2 + .../Diagnostics/ProcessFactory.cs | 2 + Emby.Server.Implementations/Dto/DtoService.cs | 2 + .../EntryPoints/AutomaticRestartEntryPoint.cs | 2 + .../EntryPoints/ExternalPortForwarding.cs | 2 + .../EntryPoints/LibraryChangedNotifier.cs | 2 + .../EntryPoints/RecordingNotifier.cs | 2 + .../EntryPoints/RefreshUsersMetadata.cs | 45 ++++--- .../EntryPoints/ServerEventNotifier.cs | 103 ++++++++------ .../EntryPoints/StartupWizard.cs | 21 +-- .../EntryPoints/UdpServerEntryPoint.cs | 35 ++--- .../EntryPoints/UserDataChangeNotifier.cs | 2 + .../HttpClientManager/HttpClientManager.cs | 1 + .../HttpServer/FileWriter.cs | 2 + .../HttpServer/HttpListenerHost.cs | 2 + .../HttpServer/HttpResultFactory.cs | 8 +- .../HttpServer/IHttpListener.cs | 2 + .../HttpServer/RangeRequestWriter.cs | 2 + .../HttpServer/ResponseFilter.cs | 12 +- .../HttpServer/Security/AuthService.cs | 2 + .../Security/AuthorizationContext.cs | 2 + .../HttpServer/Security/SessionContext.cs | 2 + .../HttpServer/StreamWriter.cs | 57 ++++---- .../HttpServer/WebSocketConnection.cs | 126 +++++++++--------- .../IO/ExtendedFileSystemInfo.cs | 2 + .../IO/FileRefresher.cs | 2 + .../IO/LibraryMonitor.cs | 10 +- .../IO/ManagedFileSystem.cs | 2 + .../IO/MbLinkShortcutHandler.cs | 2 + .../IO/StreamHelper.cs | 2 + .../Images/BaseDynamicImageProvider.cs | 2 + .../Library/CoreResolutionIgnoreRule.cs | 4 + .../Library/DefaultAuthenticationProvider.cs | 10 +- .../Library/DefaultPasswordResetProvider.cs | 13 +- .../Library/ExclusiveLiveStream.cs | 2 + .../Library/InvalidAuthProvider.cs | 11 ++ .../Library/LibraryManager.cs | 2 + .../Library/LiveStreamHelper.cs | 2 + .../Library/MediaSourceManager.cs | 2 + .../Library/MediaStreamSelector.cs | 2 + .../Library/MusicManager.cs | 2 + .../Library/PathExtensions.cs | 4 + .../Library/Resolvers/Audio/AudioResolver.cs | 4 +- .../Resolvers/Audio/MusicAlbumResolver.cs | 35 +++-- .../Resolvers/Audio/MusicArtistResolver.cs | 15 ++- .../Library/Resolvers/BaseVideoResolver.cs | 4 +- .../Library/Resolvers/Books/BookResolver.cs | 15 +-- .../Library/Resolvers/FolderResolver.cs | 4 +- .../Library/Resolvers/ItemResolver.cs | 2 +- .../Resolvers/Movies/BoxSetResolver.cs | 5 +- .../Library/Resolvers/Movies/MovieResolver.cs | 10 +- .../Library/Resolvers/PhotoAlbumResolver.cs | 10 ++ .../Library/Resolvers/PhotoResolver.cs | 2 + .../Library/Resolvers/PlaylistResolver.cs | 3 +- .../Resolvers/SpecialFolderResolver.cs | 2 + .../Library/Resolvers/TV/EpisodeResolver.cs | 7 +- .../Library/Resolvers/TV/SeriesResolver.cs | 10 +- .../Library/Resolvers/VideoResolver.cs | 2 + .../Library/SearchEngine.cs | 4 +- .../Library/UserDataManager.cs | 4 +- .../Library/UserManager.cs | 28 ++-- .../Library/UserViewManager.cs | 2 + .../Library/Validators/ArtistsPostScanTask.cs | 6 +- .../Library/Validators/ArtistsValidator.cs | 6 +- .../Library/Validators/GenresPostScanTask.cs | 3 + .../Library/Validators/GenresValidator.cs | 15 ++- .../Validators/MusicGenresPostScanTask.cs | 4 +- .../Validators/MusicGenresValidator.cs | 15 ++- .../Library/Validators/PeopleValidator.cs | 1 + .../Library/Validators/StudiosPostScanTask.cs | 6 +- .../Library/Validators/StudiosValidator.cs | 16 ++- 97 files changed, 624 insertions(+), 279 deletions(-) diff --git a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs index efaaa116c6..b622a31674 100644 --- a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs +++ b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; @@ -39,6 +41,19 @@ namespace Emby.Server.Implementations.Activity private readonly IServerApplicationHost _appHost; private readonly IDeviceManager _deviceManager; + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// public ActivityLogEntryPoint( ILogger logger, ISessionManager sessionManager, diff --git a/Emby.Server.Implementations/Activity/ActivityManager.cs b/Emby.Server.Implementations/Activity/ActivityManager.cs index 0c513ea127..a30e939121 100644 --- a/Emby.Server.Implementations/Activity/ActivityManager.cs +++ b/Emby.Server.Implementations/Activity/ActivityManager.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Linq; using MediaBrowser.Controller.Library; diff --git a/Emby.Server.Implementations/Activity/ActivityRepository.cs b/Emby.Server.Implementations/Activity/ActivityRepository.cs index ffaeaa541a..7be72319ea 100644 --- a/Emby.Server.Implementations/Activity/ActivityRepository.cs +++ b/Emby.Server.Implementations/Activity/ActivityRepository.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs index 67bb25b077..f5ca8e1448 100644 --- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs +++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs @@ -84,6 +84,7 @@ namespace Emby.Server.Implementations.AppBase /// /// The logger. protected ILogger Logger { get; private set; } + /// /// Gets the XML serializer. /// @@ -131,6 +132,10 @@ namespace Emby.Server.Implementations.AppBase } } + /// + /// Adds parts. + /// + /// The configuration factories. public virtual void AddParts(IEnumerable factories) { _configurationFactories = factories.ToArray(); @@ -223,7 +228,7 @@ namespace Emby.Server.Implementations.AppBase /// Replaces the cache path. /// /// The new configuration. - /// + /// The new cache path doesn't exist. private void ValidateCachePath(BaseApplicationConfiguration newConfig) { var newPath = newConfig.CachePath; @@ -234,7 +239,7 @@ namespace Emby.Server.Implementations.AppBase // Validate if (!Directory.Exists(newPath)) { - throw new FileNotFoundException( + throw new DirectoryNotFoundException( string.Format( CultureInfo.InvariantCulture, "{0} does not exist.", @@ -245,6 +250,10 @@ namespace Emby.Server.Implementations.AppBase } } + /// + /// Ensures that we have write access to the path. + /// + /// The path. protected void EnsureWriteAccess(string path) { var file = Path.Combine(path, Guid.NewGuid().ToString()); @@ -257,6 +266,7 @@ namespace Emby.Server.Implementations.AppBase return Path.Combine(CommonApplicationPaths.ConfigurationDirectoryPath, key.ToLowerInvariant() + ".xml"); } + /// public object GetConfiguration(string key) { return _configurations.GetOrAdd(key, k => @@ -303,6 +313,7 @@ namespace Emby.Server.Implementations.AppBase } } + /// public void SaveConfiguration(string key, object configuration) { var configurationStore = GetConfigurationStore(key); @@ -339,6 +350,11 @@ namespace Emby.Server.Implementations.AppBase OnNamedConfigurationUpdated(key, configuration); } + /// + /// Event handler for when a named configuration got updates. + /// + /// The key of the configuration. + /// The old configuration. protected virtual void OnNamedConfigurationUpdated(string key, object configuration) { NamedConfigurationUpdated?.Invoke(this, new ConfigurationUpdateEventArgs @@ -348,6 +364,7 @@ namespace Emby.Server.Implementations.AppBase }); } + /// public Type GetConfigurationType(string key) { return GetConfigurationStore(key) diff --git a/Emby.Server.Implementations/Archiving/ZipClient.cs b/Emby.Server.Implementations/Archiving/ZipClient.cs index 6b0fd2dc6c..4a6e5cfd75 100644 --- a/Emby.Server.Implementations/Archiving/ZipClient.cs +++ b/Emby.Server.Implementations/Archiving/ZipClient.cs @@ -10,15 +10,10 @@ using SharpCompress.Readers.Zip; namespace Emby.Server.Implementations.Archiving { /// - /// Class DotNetZipClient + /// Class DotNetZipClient. /// public class ZipClient : IZipClient { - public ZipClient() - { - - } - /// /// Extracts all. /// @@ -144,7 +139,6 @@ namespace Emby.Server.Implementations.Archiving } } - /// /// Extracts all from tar. /// diff --git a/Emby.Server.Implementations/Branding/BrandingConfigurationFactory.cs b/Emby.Server.Implementations/Branding/BrandingConfigurationFactory.cs index b27f84848b..93000ae127 100644 --- a/Emby.Server.Implementations/Branding/BrandingConfigurationFactory.cs +++ b/Emby.Server.Implementations/Branding/BrandingConfigurationFactory.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System.Collections.Generic; using MediaBrowser.Common.Configuration; using MediaBrowser.Model.Branding; diff --git a/Emby.Server.Implementations/Browser/BrowserLauncher.cs b/Emby.Server.Implementations/Browser/BrowserLauncher.cs index 718129ef09..f5da0d0183 100644 --- a/Emby.Server.Implementations/Browser/BrowserLauncher.cs +++ b/Emby.Server.Implementations/Browser/BrowserLauncher.cs @@ -4,7 +4,7 @@ using MediaBrowser.Controller; namespace Emby.Server.Implementations.Browser { /// - /// Class BrowserLauncher + /// Class BrowserLauncher. /// public static class BrowserLauncher { @@ -32,6 +32,7 @@ namespace Emby.Server.Implementations.Browser /// /// Opens the URL. /// + /// The application host instance. /// The URL. private static void OpenUrl(IServerApplicationHost appHost, string url) { diff --git a/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs b/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs index c10f00f9b8..6016fed079 100644 --- a/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs +++ b/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Threading; @@ -13,11 +15,16 @@ namespace Emby.Server.Implementations.Channels { private readonly ChannelManager _channelManager; + /// + /// Initializes a new instance of the class. + /// + /// The channel manager. public ChannelDynamicMediaSourceProvider(IChannelManager channelManager) { _channelManager = (ChannelManager)channelManager; } + /// public Task> GetMediaSources(BaseItem item, CancellationToken cancellationToken) { if (item.SourceType == SourceType.Channel) @@ -28,6 +35,7 @@ namespace Emby.Server.Implementations.Channels return Task.FromResult>(new List()); } + /// public Task OpenMediaSource(string openToken, List currentLiveStreams, CancellationToken cancellationToken) { throw new NotImplementedException(); diff --git a/Emby.Server.Implementations/Channels/ChannelImageProvider.cs b/Emby.Server.Implementations/Channels/ChannelImageProvider.cs index bafa68818b..62aeb9bcb9 100644 --- a/Emby.Server.Implementations/Channels/ChannelImageProvider.cs +++ b/Emby.Server.Implementations/Channels/ChannelImageProvider.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System.Collections.Generic; using System.Linq; using System.Threading; diff --git a/Emby.Server.Implementations/Channels/ChannelManager.cs b/Emby.Server.Implementations/Channels/ChannelManager.cs index 151670074a..ceca878225 100644 --- a/Emby.Server.Implementations/Channels/ChannelManager.cs +++ b/Emby.Server.Implementations/Channels/ChannelManager.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Concurrent; using System.Collections.Generic; diff --git a/Emby.Server.Implementations/Channels/ChannelPostScanTask.cs b/Emby.Server.Implementations/Channels/ChannelPostScanTask.cs index 3c7cbb1159..2712fc8c5e 100644 --- a/Emby.Server.Implementations/Channels/ChannelPostScanTask.cs +++ b/Emby.Server.Implementations/Channels/ChannelPostScanTask.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Linq; using System.Threading; diff --git a/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs b/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs index 303a8ac7b1..5774c04153 100644 --- a/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs +++ b/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Threading; diff --git a/Emby.Server.Implementations/Collections/CollectionImageProvider.cs b/Emby.Server.Implementations/Collections/CollectionImageProvider.cs index 0244c4a684..485adf14a8 100644 --- a/Emby.Server.Implementations/Collections/CollectionImageProvider.cs +++ b/Emby.Server.Implementations/Collections/CollectionImageProvider.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Linq; diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.cs index c5a77ce5b5..2b8a5bdc56 100644 --- a/Emby.Server.Implementations/Collections/CollectionManager.cs +++ b/Emby.Server.Implementations/Collections/CollectionManager.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; diff --git a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs index 2291345bee..4def7ca40d 100644 --- a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs +++ b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Globalization; using System.IO; using Emby.Server.Implementations.AppBase; using MediaBrowser.Common.Configuration; @@ -17,7 +19,6 @@ namespace Emby.Server.Implementations.Configuration /// public class ServerConfigurationManager : BaseConfigurationManager, IServerConfigurationManager { - /// /// Initializes a new instance of the class. /// @@ -31,6 +32,9 @@ namespace Emby.Server.Implementations.Configuration UpdateMetadataPath(); } + /// + /// Configuration updating event. + /// public event EventHandler> ConfigurationUpdating; /// @@ -97,7 +101,7 @@ namespace Emby.Server.Implementations.Configuration /// Validates the SSL certificate. /// /// The new configuration. - /// + /// The certificate path doesn't exist. private void ValidateSslCertificate(BaseApplicationConfiguration newConfig) { var serverConfig = (ServerConfiguration)newConfig; @@ -105,12 +109,16 @@ namespace Emby.Server.Implementations.Configuration var newPath = serverConfig.CertificatePath; if (!string.IsNullOrWhiteSpace(newPath) - && !string.Equals(Configuration.CertificatePath ?? string.Empty, newPath)) + && !string.Equals(Configuration.CertificatePath, newPath, StringComparison.Ordinal)) { // Validate if (!File.Exists(newPath)) { - throw new FileNotFoundException(string.Format("Certificate file '{0}' does not exist.", newPath)); + throw new FileNotFoundException( + string.Format( + CultureInfo.InvariantCulture, + "Certificate file '{0}' does not exist.", + newPath)); } } } @@ -119,24 +127,32 @@ namespace Emby.Server.Implementations.Configuration /// Validates the metadata path. /// /// The new configuration. - /// + /// The new config path doesn't exist. private void ValidateMetadataPath(ServerConfiguration newConfig) { var newPath = newConfig.MetadataPath; if (!string.IsNullOrWhiteSpace(newPath) - && !string.Equals(Configuration.MetadataPath ?? string.Empty, newPath)) + && !string.Equals(Configuration.MetadataPath, newPath, StringComparison.Ordinal)) { // Validate if (!Directory.Exists(newPath)) { - throw new FileNotFoundException(string.Format("{0} does not exist.", newPath)); + throw new DirectoryNotFoundException( + string.Format( + CultureInfo.InvariantCulture, + "{0} does not exist.", + newPath)); } EnsureWriteAccess(newPath); } } + /// + /// Sets all config values to the optimal value. + /// + /// If the configuration changed. public bool SetOptimalValues() { var config = Configuration; diff --git a/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs b/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs index fec7d161e5..776074b728 100644 --- a/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs +++ b/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs @@ -6,6 +6,9 @@ using static MediaBrowser.Common.Cryptography.Constants; namespace Emby.Server.Implementations.Cryptography { + /// + /// Class providing abstractions over cryptographic functions. + /// public class CryptographyProvider : ICryptoProvider, IDisposable { private static readonly HashSet _supportedHashMethods = new HashSet() @@ -42,8 +45,10 @@ namespace Emby.Server.Implementations.Cryptography _randomNumberGenerator = RandomNumberGenerator.Create(); } + /// public string DefaultHashMethod => "PBKDF2"; + /// public IEnumerable GetSupportedHashMethods() => _supportedHashMethods; @@ -62,6 +67,7 @@ namespace Emby.Server.Implementations.Cryptography throw new CryptographicException($"Cannot currently use PBKDF2 with requested hash method: {method}"); } + /// public byte[] ComputeHash(string hashMethod, byte[] bytes, byte[] salt) { if (hashMethod == DefaultHashMethod) @@ -89,12 +95,15 @@ namespace Emby.Server.Implementations.Cryptography throw new CryptographicException($"Requested hash method is not supported: {hashMethod}"); } + /// public byte[] ComputeHashWithDefaultMethod(byte[] bytes, byte[] salt) => PBKDF2(DefaultHashMethod, bytes, salt, DefaultIterations); + /// public byte[] GenerateSalt() => GenerateSalt(DefaultSaltLength); + /// public byte[] GenerateSalt(int length) { byte[] salt = new byte[length]; @@ -109,6 +118,10 @@ namespace Emby.Server.Implementations.Cryptography GC.SuppressFinalize(this); } + /// + /// Releases unmanaged and - optionally - managed resources. + /// + /// true to release both managed and unmanaged resources; false to release only unmanaged resources. protected virtual void Dispose(bool disposing) { if (_disposed) diff --git a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs index 4e392f6c9c..30f29beee4 100644 --- a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs +++ b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Linq; @@ -11,6 +13,10 @@ namespace Emby.Server.Implementations.Data { private bool _disposed = false; + /// + /// Initializes a new instance of the class. + /// + /// The ogger. protected BaseSqliteRepository(ILogger logger) { Logger = logger; diff --git a/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs b/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs index f7743a3c25..2a8f2d6b33 100644 --- a/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs +++ b/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Threading; using System.Threading.Tasks; diff --git a/Emby.Server.Implementations/Data/ManagedConnection.cs b/Emby.Server.Implementations/Data/ManagedConnection.cs index 4c34244100..5c094ddd2d 100644 --- a/Emby.Server.Implementations/Data/ManagedConnection.cs +++ b/Emby.Server.Implementations/Data/ManagedConnection.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Threading; diff --git a/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs b/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs index 2f6c1288da..d474f1c6ba 100644 --- a/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; diff --git a/Emby.Server.Implementations/Data/SqliteExtensions.cs b/Emby.Server.Implementations/Data/SqliteExtensions.cs index c76ae0cac0..c87793072e 100644 --- a/Emby.Server.Implementations/Data/SqliteExtensions.cs +++ b/Emby.Server.Implementations/Data/SqliteExtensions.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; diff --git a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs index 26ac17bdc2..22955850ab 100644 --- a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.IO; diff --git a/Emby.Server.Implementations/Data/SqliteUserRepository.cs b/Emby.Server.Implementations/Data/SqliteUserRepository.cs index 26798993b4..a042320c91 100644 --- a/Emby.Server.Implementations/Data/SqliteUserRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteUserRepository.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.IO; diff --git a/Emby.Server.Implementations/Data/TypeMapper.cs b/Emby.Server.Implementations/Data/TypeMapper.cs index 0e67affbfc..7044b1d194 100644 --- a/Emby.Server.Implementations/Data/TypeMapper.cs +++ b/Emby.Server.Implementations/Data/TypeMapper.cs @@ -5,25 +5,22 @@ using System.Linq; namespace Emby.Server.Implementations.Data { /// - /// Class TypeMapper + /// Class TypeMapper. /// public class TypeMapper { /// - /// This holds all the types in the running assemblies so that we can de-serialize properly when we don't have strong types + /// This holds all the types in the running assemblies + /// so that we can de-serialize properly when we don't have strong types. /// private readonly ConcurrentDictionary _typeMap = new ConcurrentDictionary(); - public TypeMapper() - { - } - /// /// Gets the type. /// /// Name of the type. /// Type. - /// + /// typeName is null. public Type GetType(string typeName) { if (string.IsNullOrEmpty(typeName)) diff --git a/Emby.Server.Implementations/Devices/DeviceId.cs b/Emby.Server.Implementations/Devices/DeviceId.cs index 7344dc72f3..f0d43e665b 100644 --- a/Emby.Server.Implementations/Devices/DeviceId.cs +++ b/Emby.Server.Implementations/Devices/DeviceId.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Globalization; using System.IO; diff --git a/Emby.Server.Implementations/Devices/DeviceManager.cs b/Emby.Server.Implementations/Devices/DeviceManager.cs index 36d4418512..2393f1f458 100644 --- a/Emby.Server.Implementations/Devices/DeviceManager.cs +++ b/Emby.Server.Implementations/Devices/DeviceManager.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; diff --git a/Emby.Server.Implementations/Diagnostics/CommonProcess.cs b/Emby.Server.Implementations/Diagnostics/CommonProcess.cs index 175a8f3ce4..bfa49ac5ff 100644 --- a/Emby.Server.Implementations/Diagnostics/CommonProcess.cs +++ b/Emby.Server.Implementations/Diagnostics/CommonProcess.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Diagnostics; using System.IO; diff --git a/Emby.Server.Implementations/Diagnostics/ProcessFactory.cs b/Emby.Server.Implementations/Diagnostics/ProcessFactory.cs index 14aadaaae7..02ad3c1a89 100644 --- a/Emby.Server.Implementations/Diagnostics/ProcessFactory.cs +++ b/Emby.Server.Implementations/Diagnostics/ProcessFactory.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using MediaBrowser.Model.Diagnostics; namespace Emby.Server.Implementations.Diagnostics diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 6c0e32e05b..3d622b3fce 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; diff --git a/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs index 19ea093594..d69b0909dd 100644 --- a/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs +++ b/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Linq; using System.Threading; diff --git a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs index a2619367d5..e290c62e16 100644 --- a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs +++ b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Net; diff --git a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs index 24906220d1..5f938e59a8 100644 --- a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs +++ b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; diff --git a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs index 0186da9e1e..dbb3503c41 100644 --- a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs +++ b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Linq; using System.Threading; diff --git a/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs b/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs index 3a7516dca9..1ca25ba6f3 100644 --- a/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs +++ b/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Library; @@ -12,32 +11,19 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.EntryPoints { /// - /// Class RefreshUsersMetadata + /// Class RefreshUsersMetadata. /// public class RefreshUsersMetadata : IScheduledTask, IConfigurableScheduledTask { private readonly ILogger _logger; + /// - /// The _user manager + /// The _user manager. /// private readonly IUserManager _userManager; private IFileSystem _fileSystem; - public string Name => "Refresh Users"; - - public string Key => "RefreshUsers"; - - public string Description => "Refresh user infos"; - - public string Category => "Library"; - - public bool IsHidden => true; - - public bool IsEnabled => true; - - public bool IsLogged => true; - /// /// Initializes a new instance of the class. /// @@ -48,6 +34,28 @@ namespace Emby.Server.Implementations.EntryPoints _fileSystem = fileSystem; } + /// + public string Name => "Refresh Users"; + + /// + public string Key => "RefreshUsers"; + + /// + public string Description => "Refresh user infos"; + + /// + public string Category => "Library"; + + /// + public bool IsHidden => true; + + /// + public bool IsEnabled => true; + + /// + public bool IsLogged => true; + + /// public async Task Execute(CancellationToken cancellationToken, IProgress progress) { foreach (var user in _userManager.Users) @@ -58,9 +66,10 @@ namespace Emby.Server.Implementations.EntryPoints } } + /// public IEnumerable GetDefaultTriggers() { - return new List + return new[] { new TaskTriggerInfo { diff --git a/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs b/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs index 3ff8d99685..9ccbf7535a 100644 --- a/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs +++ b/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs @@ -16,33 +16,46 @@ using MediaBrowser.Model.Tasks; namespace Emby.Server.Implementations.EntryPoints { /// - /// Class WebSocketEvents + /// Class WebSocketEvents. /// public class ServerEventNotifier : IServerEntryPoint { /// - /// The _user manager + /// The _user manager. /// private readonly IUserManager _userManager; /// - /// The _installation manager + /// The _installation manager. /// private readonly IInstallationManager _installationManager; /// - /// The _kernel + /// The _kernel. /// private readonly IServerApplicationHost _appHost; /// - /// The _task manager + /// The _task manager. /// private readonly ITaskManager _taskManager; private readonly ISessionManager _sessionManager; - public ServerEventNotifier(IServerApplicationHost appHost, IUserManager userManager, IInstallationManager installationManager, ITaskManager taskManager, ISessionManager sessionManager) + /// + /// Initializes a new instance of the class. + /// + /// The application host. + /// The user manager. + /// The installation manager. + /// The task manager. + /// The session manager. + public ServerEventNotifier( + IServerApplicationHost appHost, + IUserManager userManager, + IInstallationManager installationManager, + ITaskManager taskManager, + ISessionManager sessionManager) { _userManager = userManager; _installationManager = installationManager; @@ -51,47 +64,48 @@ namespace Emby.Server.Implementations.EntryPoints _sessionManager = sessionManager; } + /// public Task RunAsync() { - _userManager.UserDeleted += userManager_UserDeleted; - _userManager.UserUpdated += userManager_UserUpdated; - _userManager.UserPolicyUpdated += _userManager_UserPolicyUpdated; - _userManager.UserConfigurationUpdated += _userManager_UserConfigurationUpdated; + _userManager.UserDeleted += OnUserDeleted; + _userManager.UserUpdated += OnUserUpdated; + _userManager.UserPolicyUpdated += OnUserPolicyUpdated; + _userManager.UserConfigurationUpdated += OnUserConfigurationUpdated; - _appHost.HasPendingRestartChanged += kernel_HasPendingRestartChanged; + _appHost.HasPendingRestartChanged += OnHasPendingRestartChanged; - _installationManager.PluginUninstalled += InstallationManager_PluginUninstalled; - _installationManager.PackageInstalling += _installationManager_PackageInstalling; - _installationManager.PackageInstallationCancelled += _installationManager_PackageInstallationCancelled; - _installationManager.PackageInstallationCompleted += _installationManager_PackageInstallationCompleted; - _installationManager.PackageInstallationFailed += _installationManager_PackageInstallationFailed; + _installationManager.PluginUninstalled += OnPluginUninstalled; + _installationManager.PackageInstalling += OnPackageInstalling; + _installationManager.PackageInstallationCancelled += OnPackageInstallationCancelled; + _installationManager.PackageInstallationCompleted += OnPackageInstallationCompleted; + _installationManager.PackageInstallationFailed += OnPackageInstallationFailed; - _taskManager.TaskCompleted += _taskManager_TaskCompleted; + _taskManager.TaskCompleted += OnTaskCompleted; return Task.CompletedTask; } - void _installationManager_PackageInstalling(object sender, InstallationEventArgs e) + private void OnPackageInstalling(object sender, InstallationEventArgs e) { SendMessageToAdminSessions("PackageInstalling", e.InstallationInfo); } - void _installationManager_PackageInstallationCancelled(object sender, InstallationEventArgs e) + private void OnPackageInstallationCancelled(object sender, InstallationEventArgs e) { SendMessageToAdminSessions("PackageInstallationCancelled", e.InstallationInfo); } - void _installationManager_PackageInstallationCompleted(object sender, InstallationEventArgs e) + private void OnPackageInstallationCompleted(object sender, InstallationEventArgs e) { SendMessageToAdminSessions("PackageInstallationCompleted", e.InstallationInfo); } - void _installationManager_PackageInstallationFailed(object sender, InstallationFailedEventArgs e) + private void OnPackageInstallationFailed(object sender, InstallationFailedEventArgs e) { SendMessageToAdminSessions("PackageInstallationFailed", e.InstallationInfo); } - void _taskManager_TaskCompleted(object sender, TaskCompletionEventArgs e) + private void OnTaskCompleted(object sender, TaskCompletionEventArgs e) { SendMessageToAdminSessions("ScheduledTaskEnded", e.Result); } @@ -101,7 +115,7 @@ namespace Emby.Server.Implementations.EntryPoints /// /// The sender. /// The e. - void InstallationManager_PluginUninstalled(object sender, GenericEventArgs e) + private void OnPluginUninstalled(object sender, GenericEventArgs e) { SendMessageToAdminSessions("PluginUninstalled", e.Argument.GetPluginInfo()); } @@ -111,7 +125,7 @@ namespace Emby.Server.Implementations.EntryPoints /// /// The source of the event. /// The instance containing the event data. - void kernel_HasPendingRestartChanged(object sender, EventArgs e) + private void OnHasPendingRestartChanged(object sender, EventArgs e) { _sessionManager.SendRestartRequiredNotification(CancellationToken.None); } @@ -121,7 +135,7 @@ namespace Emby.Server.Implementations.EntryPoints /// /// The sender. /// The e. - void userManager_UserUpdated(object sender, GenericEventArgs e) + private void OnUserUpdated(object sender, GenericEventArgs e) { var dto = _userManager.GetUserDto(e.Argument); @@ -133,19 +147,19 @@ namespace Emby.Server.Implementations.EntryPoints /// /// The sender. /// The e. - void userManager_UserDeleted(object sender, GenericEventArgs e) + private void OnUserDeleted(object sender, GenericEventArgs e) { SendMessageToUserSession(e.Argument, "UserDeleted", e.Argument.Id.ToString("N", CultureInfo.InvariantCulture)); } - void _userManager_UserPolicyUpdated(object sender, GenericEventArgs e) + private void OnUserPolicyUpdated(object sender, GenericEventArgs e) { var dto = _userManager.GetUserDto(e.Argument); SendMessageToUserSession(e.Argument, "UserPolicyUpdated", dto); } - void _userManager_UserConfigurationUpdated(object sender, GenericEventArgs e) + private void OnUserConfigurationUpdated(object sender, GenericEventArgs e) { var dto = _userManager.GetUserDto(e.Argument); @@ -168,7 +182,11 @@ namespace Emby.Server.Implementations.EntryPoints { try { - await _sessionManager.SendMessageToUserSessions(new List { user.Id }, name, data, CancellationToken.None); + await _sessionManager.SendMessageToUserSessions( + new List { user.Id }, + name, + data, + CancellationToken.None).ConfigureAwait(false); } catch (Exception) { @@ -176,12 +194,11 @@ namespace Emby.Server.Implementations.EntryPoints } } - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// + /// public void Dispose() { Dispose(true); + GC.SuppressFinalize(this); } /// @@ -192,18 +209,20 @@ namespace Emby.Server.Implementations.EntryPoints { if (dispose) { - _userManager.UserDeleted -= userManager_UserDeleted; - _userManager.UserUpdated -= userManager_UserUpdated; - _userManager.UserPolicyUpdated -= _userManager_UserPolicyUpdated; - _userManager.UserConfigurationUpdated -= _userManager_UserConfigurationUpdated; + _userManager.UserDeleted -= OnUserDeleted; + _userManager.UserUpdated -= OnUserUpdated; + _userManager.UserPolicyUpdated -= OnUserPolicyUpdated; + _userManager.UserConfigurationUpdated -= OnUserConfigurationUpdated; - _installationManager.PluginUninstalled -= InstallationManager_PluginUninstalled; - _installationManager.PackageInstalling -= _installationManager_PackageInstalling; - _installationManager.PackageInstallationCancelled -= _installationManager_PackageInstallationCancelled; - _installationManager.PackageInstallationCompleted -= _installationManager_PackageInstallationCompleted; - _installationManager.PackageInstallationFailed -= _installationManager_PackageInstallationFailed; + _installationManager.PluginUninstalled -= OnPluginUninstalled; + _installationManager.PackageInstalling -= OnPackageInstalling; + _installationManager.PackageInstallationCancelled -= OnPackageInstallationCancelled; + _installationManager.PackageInstallationCompleted -= OnPackageInstallationCompleted; + _installationManager.PackageInstallationFailed -= OnPackageInstallationFailed; - _appHost.HasPendingRestartChanged -= kernel_HasPendingRestartChanged; + _appHost.HasPendingRestartChanged -= OnHasPendingRestartChanged; + + _taskManager.TaskCompleted -= OnTaskCompleted; } } } diff --git a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs index 8be6db87d9..9cef77dc87 100644 --- a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs +++ b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs @@ -8,21 +8,28 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.EntryPoints { /// - /// Class StartupWizard + /// Class StartupWizard. /// public class StartupWizard : IServerEntryPoint { /// - /// The _app host + /// The _app host. /// private readonly IServerApplicationHost _appHost; + /// - /// The _user manager + /// The _user manager. /// private readonly ILogger _logger; private IServerConfigurationManager _config; + /// + /// Initializes a new instance of the class. + /// + /// The application host. + /// The logger. + /// The configuration manager. public StartupWizard(IServerApplicationHost appHost, ILogger logger, IServerConfigurationManager config) { _appHost = appHost; @@ -30,9 +37,7 @@ namespace Emby.Server.Implementations.EntryPoints _config = config; } - /// - /// Runs this instance. - /// + /// public Task RunAsync() { if (!_appHost.CanLaunchWebBrowser) @@ -57,9 +62,7 @@ namespace Emby.Server.Implementations.EntryPoints return Task.CompletedTask; } - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// + /// public void Dispose() { } diff --git a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs index 5b90dc1fb0..24ac6d1fda 100644 --- a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs +++ b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs @@ -10,30 +10,36 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.EntryPoints { /// - /// Class UdpServerEntryPoint + /// Class UdpServerEntryPoint. /// public class UdpServerEntryPoint : IServerEntryPoint { /// - /// Gets or sets the UDP server. + /// The port of the UDP server. /// - /// The UDP server. - private UdpServer UdpServer { get; set; } + public const int PortNumber = 7359; /// - /// The _logger + /// The _logger. /// private readonly ILogger _logger; private readonly ISocketFactory _socketFactory; private readonly IServerApplicationHost _appHost; private readonly IJsonSerializer _json; - public const int PortNumber = 7359; + /// + /// The UDP server. + /// + private UdpServer _udpServer; /// /// Initializes a new instance of the class. /// - public UdpServerEntryPoint(ILogger logger, IServerApplicationHost appHost, IJsonSerializer json, ISocketFactory socketFactory) + public UdpServerEntryPoint( + ILogger logger, + IServerApplicationHost appHost, + IJsonSerializer json, + ISocketFactory socketFactory) { _logger = logger; _appHost = appHost; @@ -41,9 +47,7 @@ namespace Emby.Server.Implementations.EntryPoints _socketFactory = socketFactory; } - /// - /// Runs this instance. - /// + /// public Task RunAsync() { var udpServer = new UdpServer(_logger, _appHost, _json, _socketFactory); @@ -52,7 +56,7 @@ namespace Emby.Server.Implementations.EntryPoints { udpServer.Start(PortNumber); - UdpServer = udpServer; + _udpServer = udpServer; } catch (Exception ex) { @@ -62,12 +66,11 @@ namespace Emby.Server.Implementations.EntryPoints return Task.CompletedTask; } - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// + /// public void Dispose() { Dispose(true); + GC.SuppressFinalize(this); } /// @@ -78,9 +81,9 @@ namespace Emby.Server.Implementations.EntryPoints { if (dispose) { - if (UdpServer != null) + if (_udpServer != null) { - UdpServer.Dispose(); + _udpServer.Dispose(); } } } diff --git a/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs b/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs index bae3422ff6..e431da1481 100644 --- a/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs +++ b/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; diff --git a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs index 2da0191ddb..50233ea485 100644 --- a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs +++ b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs @@ -282,6 +282,7 @@ namespace Emby.Server.Implementations.HttpClientManager }; } + /// public Task Post(HttpRequestOptions options) => SendAsync(options, HttpMethod.Post); diff --git a/Emby.Server.Implementations/HttpServer/FileWriter.cs b/Emby.Server.Implementations/HttpServer/FileWriter.cs index 2c7e81361d..c1c8c3eb30 100644 --- a/Emby.Server.Implementations/HttpServer/FileWriter.cs +++ b/Emby.Server.Implementations/HttpServer/FileWriter.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs index 6dd016f8a2..2aefc9fe5d 100644 --- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Diagnostics; diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs index b5cfb6b09a..f9eb3a8979 100644 --- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; @@ -5,12 +7,10 @@ using System.IO; using System.IO.Compression; using System.Net; using System.Runtime.Serialization; -using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; using System.Xml; using Emby.Server.Implementations.Services; -using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Net; using MediaBrowser.Model.IO; using MediaBrowser.Model.Serialization; @@ -24,12 +24,12 @@ using MimeTypes = MediaBrowser.Model.Net.MimeTypes; namespace Emby.Server.Implementations.HttpServer { /// - /// Class HttpResultFactory + /// Class HttpResultFactory. /// public class HttpResultFactory : IHttpResultFactory { /// - /// The _logger + /// The _logger. /// private readonly ILogger _logger; private readonly IFileSystem _fileSystem; diff --git a/Emby.Server.Implementations/HttpServer/IHttpListener.cs b/Emby.Server.Implementations/HttpServer/IHttpListener.cs index 005656d2c1..5015937256 100644 --- a/Emby.Server.Implementations/HttpServer/IHttpListener.cs +++ b/Emby.Server.Implementations/HttpServer/IHttpListener.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Threading; using System.Threading.Tasks; diff --git a/Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs b/Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs index 320136d11a..8b9028f6bc 100644 --- a/Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs +++ b/Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; diff --git a/Emby.Server.Implementations/HttpServer/ResponseFilter.cs b/Emby.Server.Implementations/HttpServer/ResponseFilter.cs index 3e731366e2..5e0466629d 100644 --- a/Emby.Server.Implementations/HttpServer/ResponseFilter.cs +++ b/Emby.Server.Implementations/HttpServer/ResponseFilter.cs @@ -8,11 +8,17 @@ using Microsoft.Net.Http.Headers; namespace Emby.Server.Implementations.HttpServer { + /// + /// Class ResponseFilter. + /// public class ResponseFilter { - private static readonly CultureInfo _usCulture = CultureInfo.ReadOnly(new CultureInfo("en-US")); private readonly ILogger _logger; + /// + /// Initializes a new instance of the class. + /// + /// The logger. public ResponseFilter(ILogger logger) { _logger = logger; @@ -37,7 +43,7 @@ namespace Emby.Server.Implementations.HttpServer if (!string.IsNullOrEmpty(exception.Message)) { - var error = exception.Message.Replace(Environment.NewLine, " "); + var error = exception.Message.Replace(Environment.NewLine, " ", StringComparison.Ordinal); error = RemoveControlCharacters(error); res.Headers.Add("X-Application-Error-Code", error); @@ -55,7 +61,7 @@ namespace Emby.Server.Implementations.HttpServer if (hasHeaders.Headers.TryGetValue(HeaderNames.ContentLength, out string contentLength) && !string.IsNullOrEmpty(contentLength)) { - var length = long.Parse(contentLength, _usCulture); + var length = long.Parse(contentLength, CultureInfo.InvariantCulture); if (length > 0) { diff --git a/Emby.Server.Implementations/HttpServer/Security/AuthService.cs b/Emby.Server.Implementations/HttpServer/Security/AuthService.cs index 594f464989..58421aaf19 100644 --- a/Emby.Server.Implementations/HttpServer/Security/AuthService.cs +++ b/Emby.Server.Implementations/HttpServer/Security/AuthService.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Linq; using Emby.Server.Implementations.SocketSharp; diff --git a/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs b/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs index 4574486049..129faeaab0 100644 --- a/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs +++ b/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Linq; diff --git a/Emby.Server.Implementations/HttpServer/Security/SessionContext.cs b/Emby.Server.Implementations/HttpServer/Security/SessionContext.cs index 81e11d3122..166952c646 100644 --- a/Emby.Server.Implementations/HttpServer/Security/SessionContext.cs +++ b/Emby.Server.Implementations/HttpServer/Security/SessionContext.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; diff --git a/Emby.Server.Implementations/HttpServer/StreamWriter.cs b/Emby.Server.Implementations/HttpServer/StreamWriter.cs index 194d04441a..eda2360285 100644 --- a/Emby.Server.Implementations/HttpServer/StreamWriter.cs +++ b/Emby.Server.Implementations/HttpServer/StreamWriter.cs @@ -10,37 +10,20 @@ using Microsoft.Net.Http.Headers; namespace Emby.Server.Implementations.HttpServer { /// - /// Class StreamWriter + /// Class StreamWriter. /// public class StreamWriter : IAsyncStreamWriter, IHasHeaders { /// - /// Gets or sets the source stream. - /// - /// The source stream. - private Stream SourceStream { get; set; } - - private byte[] SourceBytes { get; set; } - - /// - /// The _options + /// The _options. /// private readonly IDictionary _options = new Dictionary(); - /// - /// Gets the options. - /// - /// The options. - public IDictionary Headers => _options; - - public Action OnComplete { get; set; } - public Action OnError { get; set; } /// /// Initializes a new instance of the class. /// /// The source. /// Type of the content. - /// The logger. public StreamWriter(Stream source, string contentType) { if (string.IsNullOrEmpty(contentType)) @@ -65,6 +48,7 @@ namespace Emby.Server.Implementations.HttpServer /// /// The source. /// Type of the content. + /// The content length. public StreamWriter(byte[] source, string contentType, int contentLength) { if (string.IsNullOrEmpty(contentType)) @@ -78,6 +62,31 @@ namespace Emby.Server.Implementations.HttpServer Headers[HeaderNames.ContentType] = contentType; } + /// + /// Gets or sets the source stream. + /// + /// The source stream. + private Stream SourceStream { get; set; } + + private byte[] SourceBytes { get; set; } + + /// + /// Gets the options. + /// + /// The options. + public IDictionary Headers => _options; + + /// + /// Fires when complete. + /// + public Action OnComplete { get; set; } + + /// + /// Fires when an error occours. + /// + public Action OnError { get; set; } + + /// public async Task WriteToAsync(Stream responseStream, CancellationToken cancellationToken) { try @@ -98,19 +107,13 @@ namespace Emby.Server.Implementations.HttpServer } catch { - if (OnError != null) - { - OnError(); - } + OnError?.Invoke(); throw; } finally { - if (OnComplete != null) - { - OnComplete(); - } + OnComplete?.Invoke(); } } } diff --git a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs index 54a16040f7..5d657b8a7c 100644 --- a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs +++ b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs @@ -7,7 +7,6 @@ using Emby.Server.Implementations.Net; using MediaBrowser.Controller.Net; using MediaBrowser.Model.Net; using MediaBrowser.Model.Serialization; -using MediaBrowser.Model.Services; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using UtfUnknown; @@ -15,32 +14,74 @@ using UtfUnknown; namespace Emby.Server.Implementations.HttpServer { /// - /// Class WebSocketConnection + /// Class WebSocketConnection. /// public class WebSocketConnection : IWebSocketConnection { - public event EventHandler Closed; - /// - /// The _socket - /// - private readonly IWebSocket _socket; - - /// - /// The _remote end point - /// - public string RemoteEndPoint { get; private set; } - - /// - /// The logger + /// The logger. /// private readonly ILogger _logger; /// - /// The _json serializer + /// The _json serializer. /// private readonly IJsonSerializer _jsonSerializer; + /// + /// The _socket. + /// + private readonly IWebSocket _socket; + + /// + /// Initializes a new instance of the class. + /// + /// The socket. + /// The remote end point. + /// The json serializer. + /// The logger. + /// socket + public WebSocketConnection(IWebSocket socket, string remoteEndPoint, IJsonSerializer jsonSerializer, ILogger logger) + { + if (socket == null) + { + throw new ArgumentNullException(nameof(socket)); + } + + if (string.IsNullOrEmpty(remoteEndPoint)) + { + throw new ArgumentNullException(nameof(remoteEndPoint)); + } + + if (jsonSerializer == null) + { + throw new ArgumentNullException(nameof(jsonSerializer)); + } + + if (logger == null) + { + throw new ArgumentNullException(nameof(logger)); + } + + Id = Guid.NewGuid(); + _jsonSerializer = jsonSerializer; + _socket = socket; + _socket.OnReceiveBytes = OnReceiveInternal; + + RemoteEndPoint = remoteEndPoint; + _logger = logger; + + socket.Closed += OnSocketClosed; + } + + /// + public event EventHandler Closed; + + /// + /// Gets or sets the _remote end point. + /// + public string RemoteEndPoint { get; private set; } + /// /// Gets or sets the receive action. /// @@ -64,6 +105,7 @@ namespace Emby.Server.Implementations.HttpServer /// /// The URL. public string Url { get; set; } + /// /// Gets or sets the query string. /// @@ -71,44 +113,12 @@ namespace Emby.Server.Implementations.HttpServer public IQueryCollection QueryString { get; set; } /// - /// Initializes a new instance of the class. + /// Gets the state. /// - /// The socket. - /// The remote end point. - /// The json serializer. - /// The logger. - /// socket - public WebSocketConnection(IWebSocket socket, string remoteEndPoint, IJsonSerializer jsonSerializer, ILogger logger) - { - if (socket == null) - { - throw new ArgumentNullException(nameof(socket)); - } - if (string.IsNullOrEmpty(remoteEndPoint)) - { - throw new ArgumentNullException(nameof(remoteEndPoint)); - } - if (jsonSerializer == null) - { - throw new ArgumentNullException(nameof(jsonSerializer)); - } - if (logger == null) - { - throw new ArgumentNullException(nameof(logger)); - } + /// The state. + public WebSocketState State => _socket.State; - Id = Guid.NewGuid(); - _jsonSerializer = jsonSerializer; - _socket = socket; - _socket.OnReceiveBytes = OnReceiveInternal; - - RemoteEndPoint = remoteEndPoint; - _logger = logger; - - socket.Closed += socket_Closed; - } - - void socket_Closed(object sender, EventArgs e) + void OnSocketClosed(object sender, EventArgs e) { Closed?.Invoke(this, EventArgs.Empty); } @@ -210,6 +220,7 @@ namespace Emby.Server.Implementations.HttpServer return _socket.SendAsync(buffer, true, cancellationToken); } + /// public Task SendAsync(string text, CancellationToken cancellationToken) { if (string.IsNullOrEmpty(text)) @@ -222,18 +233,11 @@ namespace Emby.Server.Implementations.HttpServer return _socket.SendAsync(text, true, cancellationToken); } - /// - /// Gets the state. - /// - /// The state. - public WebSocketState State => _socket.State; - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// + /// public void Dispose() { Dispose(true); + GC.SuppressFinalize(this); } /// diff --git a/Emby.Server.Implementations/IO/ExtendedFileSystemInfo.cs b/Emby.Server.Implementations/IO/ExtendedFileSystemInfo.cs index 48b34a3a04..3150f3367c 100644 --- a/Emby.Server.Implementations/IO/ExtendedFileSystemInfo.cs +++ b/Emby.Server.Implementations/IO/ExtendedFileSystemInfo.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + namespace Emby.Server.Implementations.IO { public class ExtendedFileSystemInfo diff --git a/Emby.Server.Implementations/IO/FileRefresher.cs b/Emby.Server.Implementations/IO/FileRefresher.cs index 40e8ed5dc7..4b5b11f01f 100644 --- a/Emby.Server.Implementations/IO/FileRefresher.cs +++ b/Emby.Server.Implementations/IO/FileRefresher.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.IO; diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.cs index aeb541c540..b1fb8cc635 100644 --- a/Emby.Server.Implementations/IO/LibraryMonitor.cs +++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -16,22 +18,22 @@ namespace Emby.Server.Implementations.IO public class LibraryMonitor : ILibraryMonitor { /// - /// The file system watchers + /// The file system watchers. /// private readonly ConcurrentDictionary _fileSystemWatchers = new ConcurrentDictionary(StringComparer.OrdinalIgnoreCase); /// - /// The affected paths + /// The affected paths. /// private readonly List _activeRefreshers = new List(); /// - /// A dynamic list of paths that should be ignored. Added to during our own file sytem modifications. + /// A dynamic list of paths that should be ignored. Added to during our own file system modifications. /// private readonly ConcurrentDictionary _tempIgnoredPaths = new ConcurrentDictionary(StringComparer.OrdinalIgnoreCase); /// - /// Any file name ending in any of these will be ignored by the watchers + /// Any file name ending in any of these will be ignored by the watchers. /// private static readonly HashSet _alwaysIgnoreFiles = new HashSet(StringComparer.OrdinalIgnoreCase) { diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.cs index ae8371a32f..442fbabd17 100644 --- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs +++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; diff --git a/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs b/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs index 5e5e91bb39..e6696b8c4c 100644 --- a/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs +++ b/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.IO; using MediaBrowser.Model.IO; diff --git a/Emby.Server.Implementations/IO/StreamHelper.cs b/Emby.Server.Implementations/IO/StreamHelper.cs index 7c8c079e39..40b397edc2 100644 --- a/Emby.Server.Implementations/IO/StreamHelper.cs +++ b/Emby.Server.Implementations/IO/StreamHelper.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Buffers; using System.IO; diff --git a/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs index 6afcf567a8..fd50f156af 100644 --- a/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs +++ b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; diff --git a/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs b/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs index 8bdb387843..bc1398332d 100644 --- a/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs +++ b/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs @@ -42,6 +42,10 @@ namespace Emby.Server.Implementations.Library ".grab", }; + /// + /// Initializes a new instance of the class. + /// + /// The library manager. public CoreResolutionIgnoreRule(ILibraryManager libraryManager) { _libraryManager = libraryManager; diff --git a/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs b/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs index c043568d55..94f60ea621 100644 --- a/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs +++ b/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs @@ -10,10 +10,17 @@ using MediaBrowser.Model.Cryptography; namespace Emby.Server.Implementations.Library { + /// + /// The default authentication provider. + /// public class DefaultAuthenticationProvider : IAuthenticationProvider, IRequiresResolvedUser { private readonly ICryptoProvider _cryptographyProvider; + /// + /// Initializes a new instance of the class. + /// + /// The cryptography provider. public DefaultAuthenticationProvider(ICryptoProvider cryptographyProvider) { _cryptographyProvider = cryptographyProvider; @@ -38,12 +45,13 @@ namespace Emby.Server.Implementations.Library // This is the version that we need to use for local users. Because reasons. public Task Authenticate(string username, string password, User resolvedUser) { - bool success = false; if (resolvedUser == null) { throw new ArgumentNullException(nameof(resolvedUser)); } + bool success = false; + // As long as jellyfin supports passwordless users, we need this little block here to accommodate if (!HasPassword(resolvedUser) && string.IsNullOrEmpty(password)) { diff --git a/Emby.Server.Implementations/Library/DefaultPasswordResetProvider.cs b/Emby.Server.Implementations/Library/DefaultPasswordResetProvider.cs index fa6bbcf91c..6c6fbd86f3 100644 --- a/Emby.Server.Implementations/Library/DefaultPasswordResetProvider.cs +++ b/Emby.Server.Implementations/Library/DefaultPasswordResetProvider.cs @@ -12,6 +12,9 @@ using MediaBrowser.Model.Users; namespace Emby.Server.Implementations.Library { + /// + /// The default password reset provider. + /// public class DefaultPasswordResetProvider : IPasswordResetProvider { private const string BaseResetFileName = "passwordreset"; @@ -22,6 +25,12 @@ namespace Emby.Server.Implementations.Library private readonly string _passwordResetFileBase; private readonly string _passwordResetFileBaseDir; + /// + /// Initializes a new instance of the class. + /// + /// The configuration manager. + /// The JSON serializer. + /// The user manager. public DefaultPasswordResetProvider( IServerConfigurationManager configurationManager, IJsonSerializer jsonSerializer, @@ -56,8 +65,8 @@ namespace Emby.Server.Implementations.Library File.Delete(resetfile); } else if (string.Equals( - spr.Pin.Replace("-", string.Empty), - pin.Replace("-", string.Empty), + spr.Pin.Replace("-", string.Empty, StringComparison.Ordinal), + pin.Replace("-", string.Empty, StringComparison.Ordinal), StringComparison.InvariantCultureIgnoreCase)) { var resetUser = _userManager.GetUserByName(spr.UserName); diff --git a/Emby.Server.Implementations/Library/ExclusiveLiveStream.cs b/Emby.Server.Implementations/Library/ExclusiveLiveStream.cs index a3c879f121..9a71868988 100644 --- a/Emby.Server.Implementations/Library/ExclusiveLiveStream.cs +++ b/Emby.Server.Implementations/Library/ExclusiveLiveStream.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Globalization; using System.Threading; diff --git a/Emby.Server.Implementations/Library/InvalidAuthProvider.cs b/Emby.Server.Implementations/Library/InvalidAuthProvider.cs index 7913df5e40..dc61aacd7b 100644 --- a/Emby.Server.Implementations/Library/InvalidAuthProvider.cs +++ b/Emby.Server.Implementations/Library/InvalidAuthProvider.cs @@ -4,37 +4,48 @@ using MediaBrowser.Controller.Entities; namespace Emby.Server.Implementations.Library { + /// + /// An invalid authentication provider. + /// public class InvalidAuthProvider : IAuthenticationProvider { + /// public string Name => "InvalidOrMissingAuthenticationProvider"; + /// public bool IsEnabled => true; + /// public Task Authenticate(string username, string password) { throw new AuthenticationException("User Account cannot login with this provider. The Normal provider for this user cannot be found"); } + /// public bool HasPassword(User user) { return true; } + /// public Task ChangePassword(User user, string newPassword) { return Task.CompletedTask; } + /// public void ChangeEasyPassword(User user, string newPassword, string newPasswordHash) { // Nothing here } + /// public string GetPasswordHash(User user) { return string.Empty; } + /// public string GetEasyPasswordHash(User user) { return string.Empty; diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 528636ecd3..4de06f84a3 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Concurrent; using System.Collections.Generic; diff --git a/Emby.Server.Implementations/Library/LiveStreamHelper.cs b/Emby.Server.Implementations/Library/LiveStreamHelper.cs index 33e6f24341..ed7d8aa402 100644 --- a/Emby.Server.Implementations/Library/LiveStreamHelper.cs +++ b/Emby.Server.Implementations/Library/LiveStreamHelper.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; diff --git a/Emby.Server.Implementations/Library/MediaSourceManager.cs b/Emby.Server.Implementations/Library/MediaSourceManager.cs index 7a26e0c37d..22193c997e 100644 --- a/Emby.Server.Implementations/Library/MediaSourceManager.cs +++ b/Emby.Server.Implementations/Library/MediaSourceManager.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Globalization; diff --git a/Emby.Server.Implementations/Library/MediaStreamSelector.cs b/Emby.Server.Implementations/Library/MediaStreamSelector.cs index 0a6c8845d1..6b9f4d052c 100644 --- a/Emby.Server.Implementations/Library/MediaStreamSelector.cs +++ b/Emby.Server.Implementations/Library/MediaStreamSelector.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Linq; diff --git a/Emby.Server.Implementations/Library/MusicManager.cs b/Emby.Server.Implementations/Library/MusicManager.cs index 10602fea76..72e120b254 100644 --- a/Emby.Server.Implementations/Library/MusicManager.cs +++ b/Emby.Server.Implementations/Library/MusicManager.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.Linq; diff --git a/Emby.Server.Implementations/Library/PathExtensions.cs b/Emby.Server.Implementations/Library/PathExtensions.cs index d3a81f6228..4fdf73b773 100644 --- a/Emby.Server.Implementations/Library/PathExtensions.cs +++ b/Emby.Server.Implementations/Library/PathExtensions.cs @@ -3,6 +3,9 @@ using System.Text.RegularExpressions; namespace Emby.Server.Implementations.Library { + /// + /// Class providing extension methods for working with paths. + /// public static class PathExtensions { /// @@ -32,6 +35,7 @@ namespace Emby.Server.Implementations.Library int end = str.IndexOf(']', start); return str.Substring(start, end - start); } + // for imdbid we also accept pattern matching if (string.Equals(attrib, "imdbid", StringComparison.OrdinalIgnoreCase)) { diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs index e39192d286..9d4bd9e593 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using System.IO; @@ -13,7 +15,7 @@ using MediaBrowser.Model.IO; namespace Emby.Server.Implementations.Library.Resolvers.Audio { /// - /// Class AudioResolver + /// Class AudioResolver. /// public class AudioResolver : ItemResolver, IMultiItemResolver { diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs index 3ce1da81a2..4a2d210d5d 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs @@ -13,7 +13,7 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Library.Resolvers.Audio { /// - /// Class MusicAlbumResolver + /// Class MusicAlbumResolver. /// public class MusicAlbumResolver : ItemResolver { @@ -21,6 +21,12 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio private readonly IFileSystem _fileSystem; private readonly ILibraryManager _libraryManager; + /// + /// Initializes a new instance of the class. + /// + /// The logger. + /// The file system. + /// The library manager. public MusicAlbumResolver(ILogger logger, IFileSystem fileSystem, ILibraryManager libraryManager) { _logger = logger; @@ -50,16 +56,25 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio return null; } - if (!args.IsDirectory) return null; + if (!args.IsDirectory) + { + return null; + } // Avoid mis-identifying top folders - if (args.HasParent()) return null; - if (args.Parent.IsRoot) return null; + if (args.HasParent()) + { + return null; + } + + if (args.Parent.IsRoot) + { + return null; + } return IsMusicAlbum(args) ? new MusicAlbum() : null; } - /// /// Determine if the supplied file data points to a music album /// @@ -78,8 +93,11 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio // Args points to an album if parent is an Artist folder or it directly contains music if (args.IsDirectory) { - //if (args.Parent is MusicArtist) return true; //saves us from testing children twice - if (ContainsMusic(args.FileSystemChildren, true, args.DirectoryService, _logger, _fileSystem, args.GetLibraryOptions(), _libraryManager)) return true; + // if (args.Parent is MusicArtist) return true; //saves us from testing children twice + if (ContainsMusic(args.FileSystemChildren, true, args.DirectoryService, _logger, _fileSystem, args.GetLibraryOptions(), _libraryManager)) + { + return true; + } } return false; @@ -88,7 +106,8 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio /// /// Determine if the supplied list contains what we should consider music /// - private bool ContainsMusic(IEnumerable list, + private bool ContainsMusic( + IEnumerable list, bool allowSubfolders, IDirectoryService directoryService, ILogger logger, diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs index 74e9b83049..ee7e849295 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs @@ -11,7 +11,7 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Library.Resolvers.Audio { /// - /// Class MusicArtistResolver + /// Class MusicArtistResolver. /// public class MusicArtistResolver : ItemResolver { @@ -20,6 +20,13 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio private readonly ILibraryManager _libraryManager; private readonly IServerConfigurationManager _config; + /// + /// Initializes a new instance of the class. + /// + /// The logger. + /// The file system. + /// The library manager. + /// The configuration manager. public MusicArtistResolver(ILogger logger, IFileSystem fileSystem, ILibraryManager libraryManager, IServerConfigurationManager config) { _logger = logger; @@ -41,7 +48,10 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio /// MusicArtist. protected override MusicArtist Resolve(ItemResolveArgs args) { - if (!args.IsDirectory) return null; + if (!args.IsDirectory) + { + return null; + } // Don't allow nested artists if (args.HasParent() || args.HasParent()) @@ -79,6 +89,5 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio // If we contain an album assume we are an artist folder return args.FileSystemChildren.Where(i => i.IsDirectory).Any(i => albumResolver.IsMusicAlbum(i.FullName, directoryService, args.GetLibraryOptions())) ? new MusicArtist() : null; } - } } diff --git a/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs b/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs index 541b13cbe1..c4bb861b8d 100644 --- a/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.IO; using System.Linq; @@ -10,7 +12,7 @@ using MediaBrowser.Model.Entities; namespace Emby.Server.Implementations.Library.Resolvers { /// - /// Resolves a Path into a Video or Video subclass + /// Resolves a Path into a Video or Video subclass. /// /// public abstract class BaseVideoResolver : MediaBrowser.Controller.Resolvers.ItemResolver diff --git a/Emby.Server.Implementations/Library/Resolvers/Books/BookResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Books/BookResolver.cs index f22554ee57..0b93ebeb81 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Books/BookResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Books/BookResolver.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using System.IO; using System.Linq; @@ -7,18 +9,10 @@ using MediaBrowser.Model.Entities; namespace Emby.Server.Implementations.Library.Resolvers.Books { - /// - /// - /// public class BookResolver : MediaBrowser.Controller.Resolvers.ItemResolver { private readonly string[] _validExtensions = { ".pdf", ".epub", ".mobi", ".cbr", ".cbz", ".azw3" }; - /// - /// - /// - /// - /// protected override Book Resolve(ItemResolveArgs args) { var collectionType = args.GetCollectionType(); @@ -47,11 +41,6 @@ namespace Emby.Server.Implementations.Library.Resolvers.Books return null; } - /// - /// - /// - /// - /// private Book GetBook(ItemResolveArgs args) { var bookFiles = args.FileSystemChildren.Where(f => diff --git a/Emby.Server.Implementations/Library/Resolvers/FolderResolver.cs b/Emby.Server.Implementations/Library/Resolvers/FolderResolver.cs index e48b6c9671..7dbce7a6ef 100644 --- a/Emby.Server.Implementations/Library/Resolvers/FolderResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/FolderResolver.cs @@ -5,7 +5,7 @@ using MediaBrowser.Controller.Resolvers; namespace Emby.Server.Implementations.Library.Resolvers { /// - /// Class FolderResolver + /// Class FolderResolver. /// public class FolderResolver : FolderResolver { @@ -32,7 +32,7 @@ namespace Emby.Server.Implementations.Library.Resolvers } /// - /// Class FolderResolver + /// Class FolderResolver. /// /// The type of the T item type. public abstract class FolderResolver : ItemResolver diff --git a/Emby.Server.Implementations/Library/Resolvers/ItemResolver.cs b/Emby.Server.Implementations/Library/Resolvers/ItemResolver.cs index a6db407140..32ccc7fdd4 100644 --- a/Emby.Server.Implementations/Library/Resolvers/ItemResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/ItemResolver.cs @@ -5,7 +5,7 @@ using MediaBrowser.Controller.Resolvers; namespace Emby.Server.Implementations.Library.Resolvers { /// - /// Class ItemResolver + /// Class ItemResolver. /// /// public abstract class ItemResolver : IItemResolver diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs index 922bd4bbb8..e4bc4a4690 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs @@ -4,12 +4,11 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Extensions; namespace Emby.Server.Implementations.Library.Resolvers.Movies { /// - /// Class BoxSetResolver + /// Class BoxSetResolver. /// public class BoxSetResolver : FolderResolver { @@ -63,7 +62,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies /// The item. private static void SetProviderIdFromPath(BaseItem item) { - //we need to only look at the name of this actual item (not parents) + // we need to only look at the name of this actual item (not parents) var justName = Path.GetFileName(item.Path); var id = justName.GetAttributeValue("tmdbid"); diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index 1b63b00a34..6c76900557 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -17,7 +17,7 @@ using MediaBrowser.Model.IO; namespace Emby.Server.Implementations.Library.Resolvers.Movies { /// - /// Class MovieResolver + /// Class MovieResolver. /// public class MovieResolver : BaseVideoResolver /// The library manager. + /// The logger. + /// The item repository. public ArtistsPostScanTask(ILibraryManager libraryManager, ILogger logger, IItemRepository itemRepo) { _libraryManager = libraryManager; diff --git a/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs b/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs index d06cda177f..dbadaeefbe 100644 --- a/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs @@ -12,17 +12,17 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Library.Validators { /// - /// Class ArtistsValidator + /// Class ArtistsValidator. /// public class ArtistsValidator { /// - /// The _library manager + /// The _library manager. /// private readonly ILibraryManager _libraryManager; /// - /// The _logger + /// The _logger. /// private readonly ILogger _logger; private readonly IItemRepository _itemRepo; diff --git a/Emby.Server.Implementations/Library/Validators/GenresPostScanTask.cs b/Emby.Server.Implementations/Library/Validators/GenresPostScanTask.cs index 3bc5c2fb2a..06d1dd89dc 100644 --- a/Emby.Server.Implementations/Library/Validators/GenresPostScanTask.cs +++ b/Emby.Server.Implementations/Library/Validators/GenresPostScanTask.cs @@ -7,6 +7,9 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Library.Validators { + /// + /// Class GenresPostScanTask. + /// public class GenresPostScanTask : ILibraryPostScanTask { /// diff --git a/Emby.Server.Implementations/Library/Validators/GenresValidator.cs b/Emby.Server.Implementations/Library/Validators/GenresValidator.cs index f8459c61f1..6478f1873e 100644 --- a/Emby.Server.Implementations/Library/Validators/GenresValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/GenresValidator.cs @@ -7,19 +7,28 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Library.Validators { - class GenresValidator + /// + /// Class GenresValidator. + /// + public class GenresValidator { /// - /// The _library manager + /// The _library manager. /// private readonly ILibraryManager _libraryManager; private readonly IItemRepository _itemRepo; /// - /// The _logger + /// The _logger. /// private readonly ILogger _logger; + /// + /// Initializes a new instance of the class. + /// + /// The library manager. + /// The logger. + /// The item repository. public GenresValidator(ILibraryManager libraryManager, ILogger logger, IItemRepository itemRepo) { _libraryManager = libraryManager; diff --git a/Emby.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs b/Emby.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs index 9ac4bf7618..1b5c83f1eb 100644 --- a/Emby.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs +++ b/Emby.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs @@ -8,12 +8,12 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Library.Validators { /// - /// Class MusicGenresPostScanTask + /// Class MusicGenresPostScanTask. /// public class MusicGenresPostScanTask : ILibraryPostScanTask { /// - /// The _library manager + /// The _library manager. /// private readonly ILibraryManager _libraryManager; private readonly ILogger _logger; diff --git a/Emby.Server.Implementations/Library/Validators/MusicGenresValidator.cs b/Emby.Server.Implementations/Library/Validators/MusicGenresValidator.cs index 710e5d0433..23a28e9360 100644 --- a/Emby.Server.Implementations/Library/Validators/MusicGenresValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/MusicGenresValidator.cs @@ -7,19 +7,28 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Library.Validators { - class MusicGenresValidator + /// + /// Class MusicGenresValidator. + /// + public class MusicGenresValidator { /// - /// The _library manager + /// The _library manager. /// private readonly ILibraryManager _libraryManager; /// - /// The _logger + /// The _logger. /// private readonly ILogger _logger; private readonly IItemRepository _itemRepo; + /// + /// Initializes a new instance of the class. + /// + /// The library manager. + /// The logger. + /// The item repository. public MusicGenresValidator(ILibraryManager libraryManager, ILogger logger, IItemRepository itemRepo) { _libraryManager = libraryManager; diff --git a/Emby.Server.Implementations/Library/Validators/PeopleValidator.cs b/Emby.Server.Implementations/Library/Validators/PeopleValidator.cs index 137a010ec3..8275c873af 100644 --- a/Emby.Server.Implementations/Library/Validators/PeopleValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/PeopleValidator.cs @@ -32,6 +32,7 @@ namespace Emby.Server.Implementations.Library.Validators /// /// The library manager. /// The logger. + /// The file system. public PeopleValidator(ILibraryManager libraryManager, ILogger logger, IFileSystem fileSystem) { _libraryManager = libraryManager; diff --git a/Emby.Server.Implementations/Library/Validators/StudiosPostScanTask.cs b/Emby.Server.Implementations/Library/Validators/StudiosPostScanTask.cs index 2efae0fe44..00899c3361 100644 --- a/Emby.Server.Implementations/Library/Validators/StudiosPostScanTask.cs +++ b/Emby.Server.Implementations/Library/Validators/StudiosPostScanTask.cs @@ -8,12 +8,12 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Library.Validators { /// - /// Class MusicGenresPostScanTask + /// Class MusicGenresPostScanTask. /// public class StudiosPostScanTask : ILibraryPostScanTask { /// - /// The _library manager + /// The _library manager. /// private readonly ILibraryManager _libraryManager; @@ -25,7 +25,7 @@ namespace Emby.Server.Implementations.Library.Validators /// /// The library manager. /// The logger. - /// Th item repository. + /// The item repository. public StudiosPostScanTask(ILibraryManager libraryManager, ILogger logger, IItemRepository itemRepo) { _libraryManager = libraryManager; diff --git a/Emby.Server.Implementations/Library/Validators/StudiosValidator.cs b/Emby.Server.Implementations/Library/Validators/StudiosValidator.cs index 93ded9e7bd..887eef5c36 100644 --- a/Emby.Server.Implementations/Library/Validators/StudiosValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/StudiosValidator.cs @@ -9,19 +9,29 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Library.Validators { - class StudiosValidator + /// + /// Class StudiosValidator. + /// + public class StudiosValidator { /// - /// The _library manager + /// The _library manager. /// private readonly ILibraryManager _libraryManager; private readonly IItemRepository _itemRepo; + /// - /// The _logger + /// The _logger. /// private readonly ILogger _logger; + /// + /// Initializes a new instance of the class. + /// + /// The library manager. + /// The logger. + /// The item repository. public StudiosValidator(ILibraryManager libraryManager, ILogger logger, IItemRepository itemRepo) { _libraryManager = libraryManager; From affb58ef9e11f7f14192c76074b1199604f6bd67 Mon Sep 17 00:00:00 2001 From: Bond-009 Date: Tue, 10 Dec 2019 16:22:03 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-Authored-By: dkanada --- .../AppBase/BaseConfigurationManager.cs | 2 +- .../Configuration/ServerConfigurationManager.cs | 2 +- Emby.Server.Implementations/Data/BaseSqliteRepository.cs | 2 +- .../EntryPoints/RefreshUsersMetadata.cs | 2 +- .../EntryPoints/ServerEventNotifier.cs | 8 ++++---- Emby.Server.Implementations/EntryPoints/StartupWizard.cs | 4 ++-- .../EntryPoints/UdpServerEntryPoint.cs | 2 +- .../HttpServer/HttpResultFactory.cs | 2 +- Emby.Server.Implementations/HttpServer/StreamWriter.cs | 2 +- .../HttpServer/WebSocketConnection.cs | 6 +++--- Emby.Server.Implementations/Library/UserManager.cs | 2 +- .../Library/Validators/ArtistsValidator.cs | 4 ++-- .../Library/Validators/GenresValidator.cs | 4 ++-- .../Library/Validators/MusicGenresPostScanTask.cs | 2 +- .../Library/Validators/MusicGenresValidator.cs | 4 ++-- .../Library/Validators/StudiosValidator.cs | 4 ++-- 16 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs index f5ca8e1448..edf68cf7c8 100644 --- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs +++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs @@ -351,7 +351,7 @@ namespace Emby.Server.Implementations.AppBase } /// - /// Event handler for when a named configuration got updates. + /// Event handler for when a named configuration has been updated. /// /// The key of the configuration. /// The old configuration. diff --git a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs index 4def7ca40d..3d8d15d197 100644 --- a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs +++ b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs @@ -150,7 +150,7 @@ namespace Emby.Server.Implementations.Configuration } /// - /// Sets all config values to the optimal value. + /// Sets all configuration values to their optimal values. /// /// If the configuration changed. public bool SetOptimalValues() diff --git a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs index 30f29beee4..0654132f41 100644 --- a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs +++ b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs @@ -16,7 +16,7 @@ namespace Emby.Server.Implementations.Data /// /// Initializes a new instance of the class. /// - /// The ogger. + /// The logger. protected BaseSqliteRepository(ILogger logger) { Logger = logger; diff --git a/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs b/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs index 1ca25ba6f3..f00996b5fe 100644 --- a/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs +++ b/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs @@ -18,7 +18,7 @@ namespace Emby.Server.Implementations.EntryPoints private readonly ILogger _logger; /// - /// The _user manager. + /// The user manager. /// private readonly IUserManager _userManager; diff --git a/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs b/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs index 9ccbf7535a..e1dbb663bc 100644 --- a/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs +++ b/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs @@ -21,22 +21,22 @@ namespace Emby.Server.Implementations.EntryPoints public class ServerEventNotifier : IServerEntryPoint { /// - /// The _user manager. + /// The user manager. /// private readonly IUserManager _userManager; /// - /// The _installation manager. + /// The installation manager. /// private readonly IInstallationManager _installationManager; /// - /// The _kernel. + /// The kernel. /// private readonly IServerApplicationHost _appHost; /// - /// The _task manager. + /// The task manager. /// private readonly ITaskManager _taskManager; diff --git a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs index 9cef77dc87..161788c636 100644 --- a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs +++ b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs @@ -13,12 +13,12 @@ namespace Emby.Server.Implementations.EntryPoints public class StartupWizard : IServerEntryPoint { /// - /// The _app host. + /// The app host. /// private readonly IServerApplicationHost _appHost; /// - /// The _user manager. + /// The user manager. /// private readonly ILogger _logger; diff --git a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs index 24ac6d1fda..9ee219854d 100644 --- a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs +++ b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs @@ -20,7 +20,7 @@ namespace Emby.Server.Implementations.EntryPoints public const int PortNumber = 7359; /// - /// The _logger. + /// The logger. /// private readonly ILogger _logger; private readonly ISocketFactory _socketFactory; diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs index f9eb3a8979..a62b4e7aff 100644 --- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -29,7 +29,7 @@ namespace Emby.Server.Implementations.HttpServer public class HttpResultFactory : IHttpResultFactory { /// - /// The _logger. + /// The logger. /// private readonly ILogger _logger; private readonly IFileSystem _fileSystem; diff --git a/Emby.Server.Implementations/HttpServer/StreamWriter.cs b/Emby.Server.Implementations/HttpServer/StreamWriter.cs index eda2360285..5afc51dbc3 100644 --- a/Emby.Server.Implementations/HttpServer/StreamWriter.cs +++ b/Emby.Server.Implementations/HttpServer/StreamWriter.cs @@ -15,7 +15,7 @@ namespace Emby.Server.Implementations.HttpServer public class StreamWriter : IAsyncStreamWriter, IHasHeaders { /// - /// The _options. + /// The options. /// private readonly IDictionary _options = new Dictionary(); diff --git a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs index 5d657b8a7c..2292d86a4a 100644 --- a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs +++ b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs @@ -24,12 +24,12 @@ namespace Emby.Server.Implementations.HttpServer private readonly ILogger _logger; /// - /// The _json serializer. + /// The json serializer. /// private readonly IJsonSerializer _jsonSerializer; /// - /// The _socket. + /// The socket. /// private readonly IWebSocket _socket; @@ -78,7 +78,7 @@ namespace Emby.Server.Implementations.HttpServer public event EventHandler Closed; /// - /// Gets or sets the _remote end point. + /// Gets or sets the remote end point. /// public string RemoteEndPoint { get; private set; } diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs index 1233dcc43e..eaad05f92b 100644 --- a/Emby.Server.Implementations/Library/UserManager.cs +++ b/Emby.Server.Implementations/Library/UserManager.cs @@ -43,7 +43,7 @@ namespace Emby.Server.Implementations.Library public class UserManager : IUserManager { /// - /// The _logger. + /// The logger. /// private readonly ILogger _logger; diff --git a/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs b/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs index dbadaeefbe..1497f4a3a7 100644 --- a/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs @@ -17,12 +17,12 @@ namespace Emby.Server.Implementations.Library.Validators public class ArtistsValidator { /// - /// The _library manager. + /// The library manager. /// private readonly ILibraryManager _libraryManager; /// - /// The _logger. + /// The logger. /// private readonly ILogger _logger; private readonly IItemRepository _itemRepo; diff --git a/Emby.Server.Implementations/Library/Validators/GenresValidator.cs b/Emby.Server.Implementations/Library/Validators/GenresValidator.cs index 6478f1873e..b0cd5f87a7 100644 --- a/Emby.Server.Implementations/Library/Validators/GenresValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/GenresValidator.cs @@ -13,13 +13,13 @@ namespace Emby.Server.Implementations.Library.Validators public class GenresValidator { /// - /// The _library manager. + /// The library manager. /// private readonly ILibraryManager _libraryManager; private readonly IItemRepository _itemRepo; /// - /// The _logger. + /// The logger. /// private readonly ILogger _logger; diff --git a/Emby.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs b/Emby.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs index 1b5c83f1eb..58549e9d76 100644 --- a/Emby.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs +++ b/Emby.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs @@ -13,7 +13,7 @@ namespace Emby.Server.Implementations.Library.Validators public class MusicGenresPostScanTask : ILibraryPostScanTask { /// - /// The _library manager. + /// The library manager. /// private readonly ILibraryManager _libraryManager; private readonly ILogger _logger; diff --git a/Emby.Server.Implementations/Library/Validators/MusicGenresValidator.cs b/Emby.Server.Implementations/Library/Validators/MusicGenresValidator.cs index 23a28e9360..5ee4ca72ea 100644 --- a/Emby.Server.Implementations/Library/Validators/MusicGenresValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/MusicGenresValidator.cs @@ -13,12 +13,12 @@ namespace Emby.Server.Implementations.Library.Validators public class MusicGenresValidator { /// - /// The _library manager. + /// The library manager. /// private readonly ILibraryManager _libraryManager; /// - /// The _logger. + /// The logger. /// private readonly ILogger _logger; private readonly IItemRepository _itemRepo; diff --git a/Emby.Server.Implementations/Library/Validators/StudiosValidator.cs b/Emby.Server.Implementations/Library/Validators/StudiosValidator.cs index 887eef5c36..15e7a0dbb8 100644 --- a/Emby.Server.Implementations/Library/Validators/StudiosValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/StudiosValidator.cs @@ -15,14 +15,14 @@ namespace Emby.Server.Implementations.Library.Validators public class StudiosValidator { /// - /// The _library manager. + /// The library manager. /// private readonly ILibraryManager _libraryManager; private readonly IItemRepository _itemRepo; /// - /// The _logger. + /// The logger. /// private readonly ILogger _logger;