The Free Software Media System - Server Backend & API
Enable nullable reference types for Emby.Server.Implementations
Bond_0097e8428e588b3
diff --git a/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs b/Emby.Server.Implementations/AppBase/BaseApplicationPaths.csindex 660bbb2deb..6edfad575a 100644--- a/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs+++ b/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs@@ -33,7 +33,7 @@ namespace Emby.Server.Implementations.AppBaseCachePath = cacheDirectoryPath;WebPath = webDirectoryPath;- DataPath = Path.Combine(ProgramDataPath, "data");+ _dataPath = Directory.CreateDirectory(Path.Combine(ProgramDataPath, "data")).FullName;}/// <summary>@@ -55,11 +55,7 @@ namespace Emby.Server.Implementations.AppBase/// Gets the folder path to the data directory./// </summary>/// <value>The data directory.</value>- public string DataPath- {- get => _dataPath;- private set => _dataPath = Directory.CreateDirectory(value).FullName;- }+ public string DataPath => _dataPath;/// <inheritdoc />public string VirtualDataPath => "%AppDataPath%";diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.csindex 4f72c8ce15..8c919db431 100644--- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs+++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Collections.Concurrent;using System.Collections.Generic;diff --git a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs b/Emby.Server.Implementations/AppBase/ConfigurationHelper.csindex 29bac66340..de770f59ec 100644--- a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs+++ b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs@@ -1,5 +1,3 @@-#nullable enable-using System;using System.IO;using System.Linq;diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.csindex 75d8fc113d..82995deb30 100644--- a/Emby.Server.Implementations/ApplicationHost.cs+++ b/Emby.Server.Implementations/ApplicationHost.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Channels/ChannelManager.cs b/Emby.Server.Implementations/Channels/ChannelManager.csindex 7324b0ee9f..448f124034 100644--- a/Emby.Server.Implementations/Channels/ChannelManager.cs+++ b/Emby.Server.Implementations/Channels/ChannelManager.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Collections.Generic;using System.Globalization;diff --git a/Emby.Server.Implementations/Collections/CollectionImageProvider.cs b/Emby.Server.Implementations/Collections/CollectionImageProvider.csindex c69a07e83e..ca84094024 100644--- a/Emby.Server.Implementations/Collections/CollectionImageProvider.cs+++ b/Emby.Server.Implementations/Collections/CollectionImageProvider.cs@@ -82,9 +82,9 @@ namespace Emby.Server.Implementations.Collectionsreturn null;}).Where(i => i != null)- .GroupBy(x => x.Id)+ .GroupBy(x => x!.Id) // We removed the null values.Select(x => x.First())- .ToList();+ .ToList()!; // Again... the list doesn't contain any null values}/// <inheritdoc />diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.csindex c56f334481..82d80fc83c 100644--- a/Emby.Server.Implementations/Collections/CollectionManager.cs+++ b/Emby.Server.Implementations/Collections/CollectionManager.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Collections.Generic;using System.IO;diff --git a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.csindex 7a8ed8c29f..ff5602f243 100644--- a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs+++ b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Globalization;using System.IO;diff --git a/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs b/Emby.Server.Implementations/Cryptography/CryptographyProvider.csindex 12a9e44e70..4a9b280852 100644--- a/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs+++ b/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs@@ -1,5 +1,3 @@-#nullable enable-using System;using System.Collections.Generic;using System.Security.Cryptography;diff --git a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs b/Emby.Server.Implementations/Data/BaseSqliteRepository.csindex c331a61124..6f23a0888e 100644--- a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs+++ b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Data/ManagedConnection.cs b/Emby.Server.Implementations/Data/ManagedConnection.csindex 5c094ddd2d..10c6f837e6 100644--- a/Emby.Server.Implementations/Data/ManagedConnection.cs+++ b/Emby.Server.Implementations/Data/ManagedConnection.cs@@ -9,7 +9,7 @@ namespace Emby.Server.Implementations.Data{public class ManagedConnection : IDisposable{- private SQLiteDatabaseConnection _db;+ private SQLiteDatabaseConnection? _db;private readonly SemaphoreSlim _writeLock;private bool _disposed = false;diff --git a/Emby.Server.Implementations/Data/SqliteExtensions.cs b/Emby.Server.Implementations/Data/SqliteExtensions.csindex a8f3feb589..e532825af5 100644--- a/Emby.Server.Implementations/Data/SqliteExtensions.cs+++ b/Emby.Server.Implementations/Data/SqliteExtensions.cs@@ -1,3 +1,4 @@+#nullable disable#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.csindex b3d8860a9e..5b4bbb3395 100644--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs b/Emby.Server.Implementations/Data/SqliteUserDataRepository.csindex e0ebd0a6cf..1756bcae08 100644--- a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs+++ b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Data/TypeMapper.cs b/Emby.Server.Implementations/Data/TypeMapper.csindex 7044b1d194..7f1306d15a 100644--- a/Emby.Server.Implementations/Data/TypeMapper.cs+++ b/Emby.Server.Implementations/Data/TypeMapper.cs@@ -13,7 +13,7 @@ namespace Emby.Server.Implementations.Data/// This holds all the types in the running assemblies/// so that we can de-serialize properly when we don't have strong types./// </summary>- private readonly ConcurrentDictionary<string, Type> _typeMap = new ConcurrentDictionary<string, Type>();+ private readonly ConcurrentDictionary<string, Type?> _typeMap = new ConcurrentDictionary<string, Type?>();/// <summary>/// Gets the type.@@ -21,7 +21,7 @@ namespace Emby.Server.Implementations.Data/// <param name="typeName">Name of the type.</param>/// <returns>Type.</returns>/// <exception cref="ArgumentNullException"><c>typeName</c> is null.</exception>- public Type GetType(string typeName)+ public Type? GetType(string typeName){if (string.IsNullOrEmpty(typeName)){@@ -36,7 +36,7 @@ namespace Emby.Server.Implementations.Data/// </summary>/// <param name="typeName">Name of the type.</param>/// <returns>Type.</returns>- private Type LookupType(string typeName)+ private Type? LookupType(string typeName){return AppDomain.CurrentDomain.GetAssemblies().Select(a => a.GetType(typeName))diff --git a/Emby.Server.Implementations/Devices/DeviceId.cs b/Emby.Server.Implementations/Devices/DeviceId.csindex fa6ac95fd3..3d15b3e768 100644--- a/Emby.Server.Implementations/Devices/DeviceId.cs+++ b/Emby.Server.Implementations/Devices/DeviceId.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Devices/DeviceManager.cs b/Emby.Server.Implementations/Devices/DeviceManager.csindex da5047d244..2637addce7 100644--- a/Emby.Server.Implementations/Devices/DeviceManager.cs+++ b/Emby.Server.Implementations/Devices/DeviceManager.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.csindex 4ae35039ab..7411239a1e 100644--- a/Emby.Server.Implementations/Dto/DtoService.cs+++ b/Emby.Server.Implementations/Dto/DtoService.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csprojindex 14f6f565c4..113863519b 100644--- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj+++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj@@ -44,6 +44,7 @@<GenerateAssemblyInfo>false</GenerateAssemblyInfo><GenerateDocumentationFile>true</GenerateDocumentationFile><TreatWarningsAsErrors Condition=" '$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>+ <Nullable>enable</Nullable><!-- https://github.com/microsoft/ApplicationInsights-dotnet/issues/2047 --><NoWarn>AD0001</NoWarn><AnalysisMode Condition=" '$(Configuration)' == 'Debug' ">AllEnabledByDefault</AnalysisMode>diff --git a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.csindex 14201ead29..cc3e4a2c24 100644--- a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs+++ b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.csindex ae1b51b4c3..5bb4100ba9 100644--- a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs+++ b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.csindex 824bb85f44..e0ca02d986 100644--- a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs+++ b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.csindex 3624e079f5..211941f443 100644--- a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs+++ b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs@@ -1,5 +1,3 @@-#nullable enable-using System;using System.Net.Sockets;using System.Threading;diff --git a/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs b/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.csindex 1989e9ed25..332fb33858 100644--- a/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs+++ b/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs b/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.csindex fbf9254d16..c87f7dbbde 100644--- a/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs+++ b/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs@@ -27,7 +27,7 @@ namespace Emby.Server.Implementations.HttpServer.Security{if (requestContext.Request.HttpContext.Items.TryGetValue("AuthorizationInfo", out var cached)){- return (AuthorizationInfo)cached;+ return (AuthorizationInfo)cached!; // Cache should never contain null}return GetAuthorization(requestContext);@@ -55,15 +55,15 @@ namespace Emby.Server.Implementations.HttpServer.Security}private AuthorizationInfo GetAuthorizationInfoFromDictionary(- in Dictionary<string, string> auth,+ in Dictionary<string, string>? auth,in IHeaderDictionary headers,in IQueryCollection queryString){- string deviceId = null;- string device = null;- string client = null;- string version = null;- string token = null;+ string? deviceId = null;+ string? device = null;+ string? client = null;+ string? version = null;+ string? token = null;if (auth != null){@@ -206,7 +206,7 @@ namespace Emby.Server.Implementations.HttpServer.Security/// </summary>/// <param name="httpReq">The HTTP req.</param>/// <returns>Dictionary{System.StringSystem.String}.</returns>- private Dictionary<string, string> GetAuthorizationDictionary(HttpContext httpReq)+ private Dictionary<string, string>? GetAuthorizationDictionary(HttpContext httpReq){var auth = httpReq.Request.Headers["X-Emby-Authorization"];@@ -223,7 +223,7 @@ namespace Emby.Server.Implementations.HttpServer.Security/// </summary>/// <param name="httpReq">The HTTP req.</param>/// <returns>Dictionary{System.StringSystem.String}.</returns>- private Dictionary<string, string> GetAuthorizationDictionary(HttpRequest httpReq)+ private Dictionary<string, string>? GetAuthorizationDictionary(HttpRequest httpReq){var auth = httpReq.Headers["X-Emby-Authorization"];@@ -240,7 +240,7 @@ namespace Emby.Server.Implementations.HttpServer.Security/// </summary>/// <param name="authorizationHeader">The authorization header.</param>/// <returns>Dictionary{System.StringSystem.String}.</returns>- private Dictionary<string, string> GetAuthorization(ReadOnlySpan<char> authorizationHeader)+ private Dictionary<string, string>? GetAuthorization(ReadOnlySpan<char> authorizationHeader){if (authorizationHeader == null){diff --git a/Emby.Server.Implementations/HttpServer/Security/SessionContext.cs b/Emby.Server.Implementations/HttpServer/Security/SessionContext.csindex dd77b45d89..c375f36ce4 100644--- a/Emby.Server.Implementations/HttpServer/Security/SessionContext.cs+++ b/Emby.Server.Implementations/HttpServer/Security/SessionContext.cs@@ -36,14 +36,14 @@ namespace Emby.Server.Implementations.HttpServer.Securityreturn GetSession((HttpContext)requestContext);}- public User GetUser(HttpContext requestContext)+ public User? GetUser(HttpContext requestContext){var session = GetSession(requestContext);return session == null || session.UserId.Equals(Guid.Empty) ? null : _userManager.GetUserById(session.UserId);}- public User GetUser(object requestContext)+ public User? GetUser(object requestContext){return GetUser(((HttpRequest)requestContext).HttpContext);}diff --git a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs b/Emby.Server.Implementations/HttpServer/WebSocketConnection.csindex 06acb56061..8f7d606692 100644--- a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs+++ b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs@@ -1,5 +1,3 @@-#nullable enable-using System;using System.Buffers;using System.IO.Pipelines;diff --git a/Emby.Server.Implementations/HttpServer/WebSocketManager.cs b/Emby.Server.Implementations/HttpServer/WebSocketManager.csindex 1bee1ac310..861c0a95e3 100644--- a/Emby.Server.Implementations/HttpServer/WebSocketManager.cs+++ b/Emby.Server.Implementations/HttpServer/WebSocketManager.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/IO/FileRefresher.cs b/Emby.Server.Implementations/IO/FileRefresher.csindex 7435e9d0bf..47a83d77ce 100644--- a/Emby.Server.Implementations/IO/FileRefresher.cs+++ b/Emby.Server.Implementations/IO/FileRefresher.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.csindex 3353fae9d8..aa80bccd72 100644--- a/Emby.Server.Implementations/IO/LibraryMonitor.cs+++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.csindex 27096ed334..6a554e68ab 100644--- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs+++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs@@ -61,7 +61,7 @@ namespace Emby.Server.Implementations.IO/// <param name="filename">The filename.</param>/// <returns>System.String.</returns>/// <exception cref="ArgumentNullException">filename</exception>- public virtual string ResolveShortcut(string filename)+ public virtual string? ResolveShortcut(string filename){if (string.IsNullOrEmpty(filename)){@@ -601,7 +601,7 @@ namespace Emby.Server.Implementations.IOreturn GetFiles(path, null, false, recursive);}- public virtual IEnumerable<FileSystemMetadata> GetFiles(string path, IReadOnlyList<string> extensions, bool enableCaseSensitiveExtensions, bool recursive = false)+ public virtual IEnumerable<FileSystemMetadata> GetFiles(string path, IReadOnlyList<string>? extensions, bool enableCaseSensitiveExtensions, bool recursive = false){var enumerationOptions = GetEnumerationOptions(recursive);@@ -655,7 +655,7 @@ namespace Emby.Server.Implementations.IOreturn GetFilePaths(path, null, false, recursive);}- public virtual IEnumerable<string> GetFilePaths(string path, string[] extensions, bool enableCaseSensitiveExtensions, bool recursive = false)+ public virtual IEnumerable<string> GetFilePaths(string path, string[]? extensions, bool enableCaseSensitiveExtensions, bool recursive = false){var enumerationOptions = GetEnumerationOptions(recursive);diff --git a/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs b/Emby.Server.Implementations/IO/MbLinkShortcutHandler.csindex e6696b8c4c..76c58d5dcd 100644--- a/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs+++ b/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs@@ -17,7 +17,7 @@ namespace Emby.Server.Implementations.IOpublic string Extension => ".mblink";- public string Resolve(string shortcutPath)+ public string? Resolve(string shortcutPath){if (string.IsNullOrEmpty(shortcutPath)){diff --git a/Emby.Server.Implementations/IO/StreamHelper.cs b/Emby.Server.Implementations/IO/StreamHelper.csindex c16ebd61b7..e4f5f4cf0b 100644--- a/Emby.Server.Implementations/IO/StreamHelper.cs+++ b/Emby.Server.Implementations/IO/StreamHelper.cs@@ -11,7 +11,7 @@ namespace Emby.Server.Implementations.IO{public class StreamHelper : IStreamHelper{- public async Task CopyToAsync(Stream source, Stream destination, int bufferSize, Action onStarted, CancellationToken cancellationToken)+ public async Task CopyToAsync(Stream source, Stream destination, int bufferSize, Action? onStarted, CancellationToken cancellationToken){byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferSize);trydiff --git a/Emby.Server.Implementations/IStartupOptions.cs b/Emby.Server.Implementations/IStartupOptions.csindex f719dc5f89..a430b9e720 100644--- a/Emby.Server.Implementations/IStartupOptions.cs+++ b/Emby.Server.Implementations/IStartupOptions.cs@@ -1,5 +1,4 @@#pragma warning disable CS1591-#nullable enablenamespace Emby.Server.Implementations{diff --git a/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.csindex 6fa3c1c618..833fb0b7a1 100644--- a/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs+++ b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs b/Emby.Server.Implementations/Images/CollectionFolderImageProvider.csindex 161b4c4528..ff5f26ce09 100644--- a/Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs+++ b/Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Images/DynamicImageProvider.cs b/Emby.Server.Implementations/Images/DynamicImageProvider.csindex 50c5314820..900b3fd9c6 100644--- a/Emby.Server.Implementations/Images/DynamicImageProvider.cs+++ b/Emby.Server.Implementations/Images/DynamicImageProvider.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Images/FolderImageProvider.cs b/Emby.Server.Implementations/Images/FolderImageProvider.csindex 0224ab32a0..859017f869 100644--- a/Emby.Server.Implementations/Images/FolderImageProvider.cs+++ b/Emby.Server.Implementations/Images/FolderImageProvider.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System.Collections.Generic;diff --git a/Emby.Server.Implementations/Images/GenreImageProvider.cs b/Emby.Server.Implementations/Images/GenreImageProvider.csindex 3817882312..6da431c68e 100644--- a/Emby.Server.Implementations/Images/GenreImageProvider.cs+++ b/Emby.Server.Implementations/Images/GenreImageProvider.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System.Collections.Generic;diff --git a/Emby.Server.Implementations/Images/PlaylistImageProvider.cs b/Emby.Server.Implementations/Images/PlaylistImageProvider.csindex a4c106e879..b8f0f0d65c 100644--- a/Emby.Server.Implementations/Images/PlaylistImageProvider.cs+++ b/Emby.Server.Implementations/Images/PlaylistImageProvider.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System.Collections.Generic;diff --git a/Emby.Server.Implementations/Library/ExclusiveLiveStream.cs b/Emby.Server.Implementations/Library/ExclusiveLiveStream.csindex 236453e805..6c65b58999 100644--- a/Emby.Server.Implementations/Library/ExclusiveLiveStream.cs+++ b/Emby.Server.Implementations/Library/ExclusiveLiveStream.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Library/IgnorePatterns.cs b/Emby.Server.Implementations/Library/IgnorePatterns.csindex e30a675931..5384c04b3b 100644--- a/Emby.Server.Implementations/Library/IgnorePatterns.cs+++ b/Emby.Server.Implementations/Library/IgnorePatterns.cs@@ -1,5 +1,3 @@-#nullable enable-using System;using System.Linq;using DotNet.Globbing;diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.csindex 4d207471a2..f8d8197d46 100644--- a/Emby.Server.Implementations/Library/LibraryManager.cs+++ b/Emby.Server.Implementations/Library/LibraryManager.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Library/LiveStreamHelper.cs b/Emby.Server.Implementations/Library/LiveStreamHelper.csindex c2951dd155..4ef7923db3 100644--- a/Emby.Server.Implementations/Library/LiveStreamHelper.cs+++ b/Emby.Server.Implementations/Library/LiveStreamHelper.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Library/MediaSourceManager.cs b/Emby.Server.Implementations/Library/MediaSourceManager.csindex 85d6d3043e..38e81d14c4 100644--- a/Emby.Server.Implementations/Library/MediaSourceManager.cs+++ b/Emby.Server.Implementations/Library/MediaSourceManager.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Library/MediaStreamSelector.cs b/Emby.Server.Implementations/Library/MediaStreamSelector.csindex 28fa062396..b833122ea0 100644--- a/Emby.Server.Implementations/Library/MediaStreamSelector.cs+++ b/Emby.Server.Implementations/Library/MediaStreamSelector.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Library/MusicManager.cs b/Emby.Server.Implementations/Library/MusicManager.csindex f8bae4fd1a..06300adebc 100644--- a/Emby.Server.Implementations/Library/MusicManager.cs+++ b/Emby.Server.Implementations/Library/MusicManager.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Library/PathExtensions.cs b/Emby.Server.Implementations/Library/PathExtensions.csindex 0de4edb7e7..86b8039fab 100644--- a/Emby.Server.Implementations/Library/PathExtensions.cs+++ b/Emby.Server.Implementations/Library/PathExtensions.cs@@ -1,5 +1,3 @@-#nullable enable-using System;using System.Diagnostics.CodeAnalysis;using MediaBrowser.Common.Providers;diff --git a/Emby.Server.Implementations/Library/ResolverHelper.cs b/Emby.Server.Implementations/Library/ResolverHelper.csindex 1d9b448741..ac75e5d3a1 100644--- a/Emby.Server.Implementations/Library/ResolverHelper.cs+++ b/Emby.Server.Implementations/Library/ResolverHelper.cs@@ -1,5 +1,3 @@-#nullable enable-using System;using System.IO;using System.Linq;diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.csindex 4ad84579d8..e893d63350 100644--- a/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.csindex bf32381ebf..8e1eccb10a 100644--- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Collections.Generic;using System.Linq;diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.csindex 60f82806fb..3d2ae95d24 100644--- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Linq;using System.Threading.Tasks;diff --git a/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs b/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.csindex 16050185fb..a3dcdc9441 100644--- a/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Library/Resolvers/Books/BookResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Books/BookResolver.csindex 0525c7e307..68076730b3 100644--- a/Emby.Server.Implementations/Library/Resolvers/Books/BookResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/Books/BookResolver.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Library/Resolvers/FolderResolver.cs b/Emby.Server.Implementations/Library/Resolvers/FolderResolver.csindex 7dbce7a6ef..7aaee017dd 100644--- a/Emby.Server.Implementations/Library/Resolvers/FolderResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/FolderResolver.cs@@ -1,3 +1,5 @@+#nullable disable+using MediaBrowser.Controller.Entities;using MediaBrowser.Controller.Library;using MediaBrowser.Controller.Resolvers;diff --git a/Emby.Server.Implementations/Library/Resolvers/ItemResolver.cs b/Emby.Server.Implementations/Library/Resolvers/ItemResolver.csindex 92fb2a753a..fa45ccf840 100644--- a/Emby.Server.Implementations/Library/Resolvers/ItemResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/ItemResolver.cs@@ -1,3 +1,5 @@+#nullable disable+using MediaBrowser.Controller.Entities;using MediaBrowser.Controller.Library;using MediaBrowser.Controller.Resolvers;diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.csindex 295e9e120b..69d71d0d9a 100644--- a/Emby.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.IO;using MediaBrowser.Controller.Entities;diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.csindex 16bf4dc4a0..02c5287646 100644--- a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Collections.Generic;using System.IO;diff --git a/Emby.Server.Implementations/Library/Resolvers/PhotoAlbumResolver.cs b/Emby.Server.Implementations/Library/Resolvers/PhotoAlbumResolver.csindex 204c8a62e7..534bc80ddc 100644--- a/Emby.Server.Implementations/Library/Resolvers/PhotoAlbumResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/PhotoAlbumResolver.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using MediaBrowser.Controller.Drawing;using MediaBrowser.Controller.Entities;diff --git a/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs b/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.csindex 3cb6542cf7..57bf40e9ec 100644--- a/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.cs b/Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.csindex 5f051321f6..ecd44be477 100644--- a/Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Library/Resolvers/SpecialFolderResolver.cs b/Emby.Server.Implementations/Library/Resolvers/SpecialFolderResolver.csindex 99f3041909..7b4e143348 100644--- a/Emby.Server.Implementations/Library/Resolvers/SpecialFolderResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/SpecialFolderResolver.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs b/Emby.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.csindex 6f29bc6494..d6ae910565 100644--- a/Emby.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Linq;using MediaBrowser.Controller.Entities;diff --git a/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs b/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.csindex 768e2e4f5b..7d707df182 100644--- a/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs@@ -1,3 +1,5 @@+#nullable disable+using System.Globalization;using Emby.Naming.TV;using MediaBrowser.Controller.Entities.TV;diff --git a/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs b/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.csindex 8fc3e3e75c..a1562abd31 100644--- a/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Library/Resolvers/VideoResolver.cs b/Emby.Server.Implementations/Library/Resolvers/VideoResolver.csindex 62268fce90..9599faea4b 100644--- a/Emby.Server.Implementations/Library/Resolvers/VideoResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/VideoResolver.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using MediaBrowser.Controller.Entities;diff --git a/Emby.Server.Implementations/Library/SearchEngine.cs b/Emby.Server.Implementations/Library/SearchEngine.csindex bcdf854ca3..26e615fa08 100644--- a/Emby.Server.Implementations/Library/SearchEngine.cs+++ b/Emby.Server.Implementations/Library/SearchEngine.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Library/UserDataManager.cs b/Emby.Server.Implementations/Library/UserDataManager.csindex 827e3c64b3..667e466133 100644--- a/Emby.Server.Implementations/Library/UserDataManager.cs+++ b/Emby.Server.Implementations/Library/UserDataManager.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Library/UserViewManager.cs b/Emby.Server.Implementations/Library/UserViewManager.csindex ac041bcf6c..e2da672a3c 100644--- a/Emby.Server.Implementations/Library/UserViewManager.cs+++ b/Emby.Server.Implementations/Library/UserViewManager.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.csindex 7a6b1d8b61..3fcadf5b1b 100644--- a/Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.csindex 28a2095e16..7970631201 100644--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.csindex 9372b0f6c3..26e4ef1ed9 100644--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EpgChannelData.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EpgChannelData.csindex 8c27ca76e3..0ec52a9598 100644--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EpgChannelData.cs+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EpgChannelData.cs@@ -6,7 +6,6 @@ using MediaBrowser.Controller.LiveTv;namespace Emby.Server.Implementations.LiveTv.EmbyTV{-internal class EpgChannelData{@@ -39,13 +38,13 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV}}- public ChannelInfo GetChannelById(string id)+ public ChannelInfo? GetChannelById(string id)=> _channelsById.GetValueOrDefault(id);- public ChannelInfo GetChannelByNumber(string number)+ public ChannelInfo? GetChannelByNumber(string number)=> _channelsByNumber.GetValueOrDefault(number);- public ChannelInfo GetChannelByName(string name)+ public ChannelInfo? GetChannelByName(string name)=> _channelsByName.GetValueOrDefault(name);public static string NormalizeName(string value)diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.csindex 1cac9cb963..bdab8c3e4b 100644--- a/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.csindex 32245f899e..1088638691 100644--- a/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.csindex 1efa90e256..6c52a9a73d 100644--- a/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.csindex 9af65cabba..00d02873c5 100644--- a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs+++ b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.csindex 6824aa4423..ebad4eddf1 100644--- a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs+++ b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs b/Emby.Server.Implementations/LiveTv/LiveTvDtoService.csindex 6af49dd45e..21e1409ac0 100644--- a/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs+++ b/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.csindex 1145d8aa1e..1f16289002 100644--- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs+++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs b/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.csindex 3a738fd5d2..ecd28097d3 100644--- a/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs+++ b/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.csindex fbcd4ef372..00a37bb022 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/Channels.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/Channels.csindex 740cbb66ee..0f04531896 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/Channels.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/Channels.cs@@ -1,3 +1,5 @@+#nullable disable+namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun{internal class Channelsdiff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/DiscoverResponse.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/DiscoverResponse.csindex 09d77f8382..42068cd340 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/DiscoverResponse.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/DiscoverResponse.cs@@ -1,3 +1,5 @@+#nullable disable+using System;namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerundiff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.csindex bbac6e0551..c5700db715 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.csindex a7fda1d72e..3016eeda24 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.csindex b16ccc561a..50a2d9abb3 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/LiveStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/LiveStream.csindex f8baf55da7..96a678c1d3 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/LiveStream.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/LiveStream.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.csindex 4b170b2e4e..69035dac96 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.csindex 84d4161499..48a0c3cd37 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.csindex eeb2426f4f..137ed27e20 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Localization/LocalizationManager.cs b/Emby.Server.Implementations/Localization/LocalizationManager.csindex 220e423bf5..dd5dee1d16 100644--- a/Emby.Server.Implementations/Localization/LocalizationManager.cs+++ b/Emby.Server.Implementations/Localization/LocalizationManager.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Collections.Concurrent;using System.Collections.Generic;diff --git a/Emby.Server.Implementations/MediaEncoder/EncodingManager.cs b/Emby.Server.Implementations/MediaEncoder/EncodingManager.csindex 031b5d2e72..8aaa1f7bbe 100644--- a/Emby.Server.Implementations/MediaEncoder/EncodingManager.cs+++ b/Emby.Server.Implementations/MediaEncoder/EncodingManager.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Net/SocketFactory.cs b/Emby.Server.Implementations/Net/SocketFactory.csindex 0781a0e333..1377286168 100644--- a/Emby.Server.Implementations/Net/SocketFactory.cs+++ b/Emby.Server.Implementations/Net/SocketFactory.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Net/UdpSocket.cs b/Emby.Server.Implementations/Net/UdpSocket.csindex 4e25768cf6..a8b18d2925 100644--- a/Emby.Server.Implementations/Net/UdpSocket.cs+++ b/Emby.Server.Implementations/Net/UdpSocket.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Playlists/PlaylistManager.cs b/Emby.Server.Implementations/Playlists/PlaylistManager.csindex 2d1a559f16..9a1ca99467 100644--- a/Emby.Server.Implementations/Playlists/PlaylistManager.cs+++ b/Emby.Server.Implementations/Playlists/PlaylistManager.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Plugins/PluginManager.cs b/Emby.Server.Implementations/Plugins/PluginManager.csindex 14df20936c..48281b75f6 100644--- a/Emby.Server.Implementations/Plugins/PluginManager.cs+++ b/Emby.Server.Implementations/Plugins/PluginManager.cs@@ -1,5 +1,3 @@-#nullable enable-using System;using System.Collections.Generic;using System.Globalization;diff --git a/Emby.Server.Implementations/QuickConnect/QuickConnectManager.cs b/Emby.Server.Implementations/QuickConnect/QuickConnectManager.csindex 0259dc436b..7cfd1fced9 100644--- a/Emby.Server.Implementations/QuickConnect/QuickConnectManager.cs+++ b/Emby.Server.Implementations/QuickConnect/QuickConnectManager.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Collections.Concurrent;using System.Globalization;diff --git a/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs b/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.csindex 101d9b5377..ccbd4289ea 100644--- a/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs+++ b/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/ScheduledTasks/TaskManager.cs b/Emby.Server.Implementations/ScheduledTasks/TaskManager.csindex af316e1083..4f0df75bf8 100644--- a/Emby.Server.Implementations/ScheduledTasks/TaskManager.cs+++ b/Emby.Server.Implementations/ScheduledTasks/TaskManager.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.csindex 2312c85d97..baeb86a221 100644--- a/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs+++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs@@ -140,8 +140,10 @@ namespace Emby.Server.Implementations.ScheduledTaskspreviouslyFailedImages.Add(key);var parentPath = Path.GetDirectoryName(failHistoryPath);-- Directory.CreateDirectory(parentPath);+ if (parentPath != null)+ {+ Directory.CreateDirectory(parentPath);+ }string text = string.Join('|', previouslyFailedImages);File.WriteAllText(failHistoryPath, text);diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/CleanActivityLogTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/CleanActivityLogTask.csindex 4abbf784b2..50ba9bc899 100644--- a/Emby.Server.Implementations/ScheduledTasks/Tasks/CleanActivityLogTask.cs+++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/CleanActivityLogTask.cs@@ -1,4 +1,4 @@-using System;+using System;using System.Collections.Generic;using System.Linq;using System.Threading;@@ -75,4 +75,4 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasksreturn Enumerable.Empty<TaskTriggerInfo>();}}-}\ No newline at end of file+}diff --git a/Emby.Server.Implementations/ScheduledTasks/Triggers/DailyTrigger.cs b/Emby.Server.Implementations/ScheduledTasks/Triggers/DailyTrigger.csindex 3b40320ab8..3b63536a42 100644--- a/Emby.Server.Implementations/ScheduledTasks/Triggers/DailyTrigger.cs+++ b/Emby.Server.Implementations/ScheduledTasks/Triggers/DailyTrigger.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Threading;using MediaBrowser.Model.Tasks;diff --git a/Emby.Server.Implementations/ScheduledTasks/Triggers/IntervalTrigger.cs b/Emby.Server.Implementations/ScheduledTasks/Triggers/IntervalTrigger.csindex b04fd7c7e2..e13782fe02 100644--- a/Emby.Server.Implementations/ScheduledTasks/Triggers/IntervalTrigger.cs+++ b/Emby.Server.Implementations/ScheduledTasks/Triggers/IntervalTrigger.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Linq;using System.Threading;diff --git a/Emby.Server.Implementations/ScheduledTasks/Triggers/StartupTrigger.cs b/Emby.Server.Implementations/ScheduledTasks/Triggers/StartupTrigger.csindex 7cd5493da8..ced14195bb 100644--- a/Emby.Server.Implementations/ScheduledTasks/Triggers/StartupTrigger.cs+++ b/Emby.Server.Implementations/ScheduledTasks/Triggers/StartupTrigger.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/ScheduledTasks/Triggers/WeeklyTrigger.cs b/Emby.Server.Implementations/ScheduledTasks/Triggers/WeeklyTrigger.csindex 0c0ebec082..a67f940b75 100644--- a/Emby.Server.Implementations/ScheduledTasks/Triggers/WeeklyTrigger.cs+++ b/Emby.Server.Implementations/ScheduledTasks/Triggers/WeeklyTrigger.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Threading;using MediaBrowser.Model.Tasks;diff --git a/Emby.Server.Implementations/Security/AuthenticationRepository.cs b/Emby.Server.Implementations/Security/AuthenticationRepository.csindex 76f863c951..30823ab8f5 100644--- a/Emby.Server.Implementations/Security/AuthenticationRepository.cs+++ b/Emby.Server.Implementations/Security/AuthenticationRepository.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Serialization/MyXmlSerializer.cs b/Emby.Server.Implementations/Serialization/MyXmlSerializer.csindex 27024e4e1c..8d8b82f0a4 100644--- a/Emby.Server.Implementations/Serialization/MyXmlSerializer.cs+++ b/Emby.Server.Implementations/Serialization/MyXmlSerializer.cs@@ -19,7 +19,9 @@ namespace Emby.Server.Implementations.Serializationnew ConcurrentDictionary<string, XmlSerializer>();private static XmlSerializer GetSerializer(Type type)- => _serializers.GetOrAdd(type.FullName, _ => new XmlSerializer(type));+ => _serializers.GetOrAdd(+ type.FullName ?? throw new ArgumentException($"Invalid type {type}."),+ _ => new XmlSerializer(type));/// <summary>/// Serializes to writer.@@ -38,7 +40,7 @@ namespace Emby.Server.Implementations.Serialization/// <param name="type">The type.</param>/// <param name="stream">The stream.</param>/// <returns>System.Object.</returns>- public object DeserializeFromStream(Type type, Stream stream)+ public object? DeserializeFromStream(Type type, Stream stream){using (var reader = XmlReader.Create(stream)){@@ -81,7 +83,7 @@ namespace Emby.Server.Implementations.Serialization/// <param name="type">The type.</param>/// <param name="file">The file.</param>/// <returns>System.Object.</returns>- public object DeserializeFromFile(Type type, string file)+ public object? DeserializeFromFile(Type type, string file){using (var stream = File.OpenRead(file)){@@ -95,7 +97,7 @@ namespace Emby.Server.Implementations.Serialization/// <param name="type">The type.</param>/// <param name="buffer">The buffer.</param>/// <returns>System.Object.</returns>- public object DeserializeFromBytes(Type type, byte[] buffer)+ public object? DeserializeFromBytes(Type type, byte[] buffer){using (var stream = new MemoryStream(buffer, 0, buffer.Length, false, true)){diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.csindex 6844152ea5..ef467da7ed 100644--- a/Emby.Server.Implementations/Session/SessionManager.cs+++ b/Emby.Server.Implementations/Session/SessionManager.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs b/Emby.Server.Implementations/Session/SessionWebSocketListener.csindex 39c369a01d..e9e3ca7f4b 100644--- a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs+++ b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Collections.Generic;using System.Linq;diff --git a/Emby.Server.Implementations/Session/WebSocketController.cs b/Emby.Server.Implementations/Session/WebSocketController.csindex a653b58c2b..ed1dfca592 100644--- a/Emby.Server.Implementations/Session/WebSocketController.cs+++ b/Emby.Server.Implementations/Session/WebSocketController.cs@@ -1,6 +1,5 @@#pragma warning disable CS1591#pragma warning disable SA1600-#nullable enableusing System;using System.Collections.Generic;diff --git a/Emby.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs b/Emby.Server.Implementations/Sorting/AiredEpisodeOrderComparer.csindex 60698e803d..2b0ab536f9 100644--- a/Emby.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs+++ b/Emby.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs@@ -16,7 +16,7 @@ namespace Emby.Server.Implementations.Sorting/// <param name="x">The x.</param>/// <param name="y">The y.</param>/// <returns>System.Int32.</returns>- public int Compare(BaseItem x, BaseItem y)+ public int Compare(BaseItem? x, BaseItem? y){if (x == null){diff --git a/Emby.Server.Implementations/Sorting/AlbumArtistComparer.cs b/Emby.Server.Implementations/Sorting/AlbumArtistComparer.csindex 7657cc74e1..42e644970c 100644--- a/Emby.Server.Implementations/Sorting/AlbumArtistComparer.cs+++ b/Emby.Server.Implementations/Sorting/AlbumArtistComparer.cs@@ -18,7 +18,7 @@ namespace Emby.Server.Implementations.Sorting/// <param name="x">The x.</param>/// <param name="y">The y.</param>/// <returns>System.Int32.</returns>- public int Compare(BaseItem x, BaseItem y)+ public int Compare(BaseItem? x, BaseItem? y){return string.Compare(GetValue(x), GetValue(y), StringComparison.CurrentCultureIgnoreCase);}@@ -28,7 +28,7 @@ namespace Emby.Server.Implementations.Sorting/// </summary>/// <param name="x">The x.</param>/// <returns>System.String.</returns>- private static string GetValue(BaseItem x)+ private static string? GetValue(BaseItem? x){var audio = x as IHasAlbumArtist;diff --git a/Emby.Server.Implementations/Sorting/AlbumComparer.cs b/Emby.Server.Implementations/Sorting/AlbumComparer.csindex 7dfdd9ecff..1db3f5e9ca 100644--- a/Emby.Server.Implementations/Sorting/AlbumComparer.cs+++ b/Emby.Server.Implementations/Sorting/AlbumComparer.cs@@ -17,7 +17,7 @@ namespace Emby.Server.Implementations.Sorting/// <param name="x">The x.</param>/// <param name="y">The y.</param>/// <returns>System.Int32.</returns>- public int Compare(BaseItem x, BaseItem y)+ public int Compare(BaseItem? x, BaseItem? y){return string.Compare(GetValue(x), GetValue(y), StringComparison.CurrentCultureIgnoreCase);}@@ -27,7 +27,7 @@ namespace Emby.Server.Implementations.Sorting/// </summary>/// <param name="x">The x.</param>/// <returns>System.String.</returns>- private static string GetValue(BaseItem x)+ private static string? GetValue(BaseItem? x){var audio = x as Audio;diff --git a/Emby.Server.Implementations/Sorting/ArtistComparer.cs b/Emby.Server.Implementations/Sorting/ArtistComparer.csindex 756d3c5b6c..98bee3fd9f 100644--- a/Emby.Server.Implementations/Sorting/ArtistComparer.cs+++ b/Emby.Server.Implementations/Sorting/ArtistComparer.cs@@ -15,7 +15,7 @@ namespace Emby.Server.Implementations.Sortingpublic string Name => ItemSortBy.Artist;/// <inheritdoc />- public int Compare(BaseItem x, BaseItem y)+ public int Compare(BaseItem? x, BaseItem? y){return string.Compare(GetValue(x), GetValue(y), StringComparison.CurrentCultureIgnoreCase);}@@ -25,7 +25,7 @@ namespace Emby.Server.Implementations.Sorting/// </summary>/// <param name="x">The x.</param>/// <returns>System.String.</returns>- private static string GetValue(BaseItem x)+ private static string? GetValue(BaseItem? x){if (!(x is Audio audio)){diff --git a/Emby.Server.Implementations/Sorting/CommunityRatingComparer.cs b/Emby.Server.Implementations/Sorting/CommunityRatingComparer.csindex 980954ba03..5f142fa4bb 100644--- a/Emby.Server.Implementations/Sorting/CommunityRatingComparer.cs+++ b/Emby.Server.Implementations/Sorting/CommunityRatingComparer.cs@@ -21,7 +21,7 @@ namespace Emby.Server.Implementations.Sorting/// <param name="x">The x.</param>/// <param name="y">The y.</param>/// <returns>System.Int32.</returns>- public int Compare(BaseItem x, BaseItem y)+ public int Compare(BaseItem? x, BaseItem? y){if (x == null){diff --git a/Emby.Server.Implementations/Sorting/CriticRatingComparer.cs b/Emby.Server.Implementations/Sorting/CriticRatingComparer.csindex fa136c36d0..d20dedc2d4 100644--- a/Emby.Server.Implementations/Sorting/CriticRatingComparer.cs+++ b/Emby.Server.Implementations/Sorting/CriticRatingComparer.cs@@ -15,14 +15,14 @@ namespace Emby.Server.Implementations.Sorting/// <param name="x">The x.</param>/// <param name="y">The y.</param>/// <returns>System.Int32.</returns>- public int Compare(BaseItem x, BaseItem y)+ public int Compare(BaseItem? x, BaseItem? y){return GetValue(x).CompareTo(GetValue(y));}- private static float GetValue(BaseItem x)+ private static float GetValue(BaseItem? x){- return x.CriticRating ?? 0;+ return x?.CriticRating ?? 0;}/// <summary>diff --git a/Emby.Server.Implementations/Sorting/DateCreatedComparer.cs b/Emby.Server.Implementations/Sorting/DateCreatedComparer.csindex cbca300d2f..d3f10f78cb 100644--- a/Emby.Server.Implementations/Sorting/DateCreatedComparer.cs+++ b/Emby.Server.Implementations/Sorting/DateCreatedComparer.cs@@ -16,7 +16,7 @@ namespace Emby.Server.Implementations.Sorting/// <param name="x">The x.</param>/// <param name="y">The y.</param>/// <returns>System.Int32.</returns>- public int Compare(BaseItem x, BaseItem y)+ public int Compare(BaseItem? x, BaseItem? y){if (x == null){diff --git a/Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs b/Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.csindex 03ff19d21c..b1cb123ce1 100644--- a/Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs+++ b/Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs@@ -1,3 +1,4 @@+#nullable disable#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Sorting/DatePlayedComparer.cs b/Emby.Server.Implementations/Sorting/DatePlayedComparer.csindex 16bd2aff86..08a44319f2 100644--- a/Emby.Server.Implementations/Sorting/DatePlayedComparer.cs+++ b/Emby.Server.Implementations/Sorting/DatePlayedComparer.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using Jellyfin.Data.Entities;using MediaBrowser.Controller.Entities;diff --git a/Emby.Server.Implementations/Sorting/IsFavoriteOrLikeComparer.cs b/Emby.Server.Implementations/Sorting/IsFavoriteOrLikeComparer.csindex 0c4e82d011..73e628cf75 100644--- a/Emby.Server.Implementations/Sorting/IsFavoriteOrLikeComparer.cs+++ b/Emby.Server.Implementations/Sorting/IsFavoriteOrLikeComparer.cs@@ -1,3 +1,4 @@+#nullable disable#pragma warning disable CS1591using Jellyfin.Data.Entities;diff --git a/Emby.Server.Implementations/Sorting/IsFolderComparer.cs b/Emby.Server.Implementations/Sorting/IsFolderComparer.csindex a35192eff8..3c5ddeefaa 100644--- a/Emby.Server.Implementations/Sorting/IsFolderComparer.cs+++ b/Emby.Server.Implementations/Sorting/IsFolderComparer.cs@@ -20,7 +20,7 @@ namespace Emby.Server.Implementations.Sorting/// <param name="x">The x.</param>/// <param name="y">The y.</param>/// <returns>System.Int32.</returns>- public int Compare(BaseItem x, BaseItem y)+ public int Compare(BaseItem? x, BaseItem? y){return GetValue(x).CompareTo(GetValue(y));}@@ -30,9 +30,9 @@ namespace Emby.Server.Implementations.Sorting/// </summary>/// <param name="x">The x.</param>/// <returns>System.String.</returns>- private static int GetValue(BaseItem x)+ private static int GetValue(BaseItem? x){- return x.IsFolder ? 0 : 1;+ return x?.IsFolder ?? true ? 0 : 1;}}}diff --git a/Emby.Server.Implementations/Sorting/IsPlayedComparer.cs b/Emby.Server.Implementations/Sorting/IsPlayedComparer.csindex d95948406f..7d77a8bc5a 100644--- a/Emby.Server.Implementations/Sorting/IsPlayedComparer.cs+++ b/Emby.Server.Implementations/Sorting/IsPlayedComparer.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using Jellyfin.Data.Entities;diff --git a/Emby.Server.Implementations/Sorting/IsUnplayedComparer.cs b/Emby.Server.Implementations/Sorting/IsUnplayedComparer.csindex 1632c5a7a9..926835f906 100644--- a/Emby.Server.Implementations/Sorting/IsUnplayedComparer.cs+++ b/Emby.Server.Implementations/Sorting/IsUnplayedComparer.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using Jellyfin.Data.Entities;diff --git a/Emby.Server.Implementations/Sorting/NameComparer.cs b/Emby.Server.Implementations/Sorting/NameComparer.csindex da020d8d8e..4de81a69e3 100644--- a/Emby.Server.Implementations/Sorting/NameComparer.cs+++ b/Emby.Server.Implementations/Sorting/NameComparer.cs@@ -16,7 +16,7 @@ namespace Emby.Server.Implementations.Sorting/// <param name="x">The x.</param>/// <param name="y">The y.</param>/// <returns>System.Int32.</returns>- public int Compare(BaseItem x, BaseItem y)+ public int Compare(BaseItem? x, BaseItem? y){if (x == null){diff --git a/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs b/Emby.Server.Implementations/Sorting/OfficialRatingComparer.csindex 76bb798b5f..a81f78ebfc 100644--- a/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs+++ b/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs@@ -29,7 +29,7 @@ namespace Emby.Server.Implementations.Sorting/// <param name="x">The x.</param>/// <param name="y">The y.</param>/// <returns>System.Int32.</returns>- public int Compare(BaseItem x, BaseItem y)+ public int Compare(BaseItem? x, BaseItem? y){if (x == null){diff --git a/Emby.Server.Implementations/Sorting/PlayCountComparer.cs b/Emby.Server.Implementations/Sorting/PlayCountComparer.csindex 5c28303229..04e4865cbf 100644--- a/Emby.Server.Implementations/Sorting/PlayCountComparer.cs+++ b/Emby.Server.Implementations/Sorting/PlayCountComparer.cs@@ -1,3 +1,5 @@+#nullable disable+using Jellyfin.Data.Entities;using MediaBrowser.Controller.Entities;using MediaBrowser.Controller.Library;diff --git a/Emby.Server.Implementations/Sorting/PremiereDateComparer.cs b/Emby.Server.Implementations/Sorting/PremiereDateComparer.csindex 92ac04dc66..c98f97bf1e 100644--- a/Emby.Server.Implementations/Sorting/PremiereDateComparer.cs+++ b/Emby.Server.Implementations/Sorting/PremiereDateComparer.cs@@ -16,7 +16,7 @@ namespace Emby.Server.Implementations.Sorting/// <param name="x">The x.</param>/// <param name="y">The y.</param>/// <returns>System.Int32.</returns>- public int Compare(BaseItem x, BaseItem y)+ public int Compare(BaseItem? x, BaseItem? y){return GetDate(x).CompareTo(GetDate(y));}@@ -26,8 +26,13 @@ namespace Emby.Server.Implementations.Sorting/// </summary>/// <param name="x">The x.</param>/// <returns>DateTime.</returns>- private static DateTime GetDate(BaseItem x)+ private static DateTime GetDate(BaseItem? x){+ if (x == null)+ {+ return DateTime.MinValue;+ }+if (x.PremiereDate.HasValue){return x.PremiereDate.Value;diff --git a/Emby.Server.Implementations/Sorting/ProductionYearComparer.cs b/Emby.Server.Implementations/Sorting/ProductionYearComparer.csindex e2857df0b9..df9f9957d6 100644--- a/Emby.Server.Implementations/Sorting/ProductionYearComparer.cs+++ b/Emby.Server.Implementations/Sorting/ProductionYearComparer.cs@@ -15,7 +15,7 @@ namespace Emby.Server.Implementations.Sorting/// <param name="x">The x.</param>/// <param name="y">The y.</param>/// <returns>System.Int32.</returns>- public int Compare(BaseItem x, BaseItem y)+ public int Compare(BaseItem? x, BaseItem? y){return GetValue(x).CompareTo(GetValue(y));}@@ -25,8 +25,13 @@ namespace Emby.Server.Implementations.Sorting/// </summary>/// <param name="x">The x.</param>/// <returns>DateTime.</returns>- private static int GetValue(BaseItem x)+ private static int GetValue(BaseItem? x){+ if (x == null)+ {+ return 0;+ }+if (x.ProductionYear.HasValue){return x.ProductionYear.Value;diff --git a/Emby.Server.Implementations/Sorting/RandomComparer.cs b/Emby.Server.Implementations/Sorting/RandomComparer.csindex 7739d04182..af3bc27508 100644--- a/Emby.Server.Implementations/Sorting/RandomComparer.cs+++ b/Emby.Server.Implementations/Sorting/RandomComparer.cs@@ -16,7 +16,7 @@ namespace Emby.Server.Implementations.Sorting/// <param name="x">The x.</param>/// <param name="y">The y.</param>/// <returns>System.Int32.</returns>- public int Compare(BaseItem x, BaseItem y)+ public int Compare(BaseItem? x, BaseItem? y){return Guid.NewGuid().CompareTo(Guid.NewGuid());}diff --git a/Emby.Server.Implementations/Sorting/RuntimeComparer.cs b/Emby.Server.Implementations/Sorting/RuntimeComparer.csindex dde44333d5..1293153031 100644--- a/Emby.Server.Implementations/Sorting/RuntimeComparer.cs+++ b/Emby.Server.Implementations/Sorting/RuntimeComparer.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using MediaBrowser.Controller.Entities;using MediaBrowser.Controller.Sorting;diff --git a/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs b/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.csindex b9205ee076..4123a59f8b 100644--- a/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs+++ b/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Sorting/SortNameComparer.cs b/Emby.Server.Implementations/Sorting/SortNameComparer.csindex f745e193b4..8d30716d39 100644--- a/Emby.Server.Implementations/Sorting/SortNameComparer.cs+++ b/Emby.Server.Implementations/Sorting/SortNameComparer.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using MediaBrowser.Controller.Entities;using MediaBrowser.Controller.Sorting;diff --git a/Emby.Server.Implementations/Sorting/StartDateComparer.cs b/Emby.Server.Implementations/Sorting/StartDateComparer.csindex 558a3d3513..c3df7c47e6 100644--- a/Emby.Server.Implementations/Sorting/StartDateComparer.cs+++ b/Emby.Server.Implementations/Sorting/StartDateComparer.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Sorting/StudioComparer.cs b/Emby.Server.Implementations/Sorting/StudioComparer.csindex 5766dc542b..01445c5254 100644--- a/Emby.Server.Implementations/Sorting/StudioComparer.cs+++ b/Emby.Server.Implementations/Sorting/StudioComparer.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/SyncPlay/Group.cs b/Emby.Server.Implementations/SyncPlay/Group.csindex 7c2ad2477a..12efff261b 100644--- a/Emby.Server.Implementations/SyncPlay/Group.cs+++ b/Emby.Server.Implementations/SyncPlay/Group.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Collections.Generic;using System.Linq;diff --git a/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs b/Emby.Server.Implementations/SyncPlay/SyncPlayManager.csindex 72c0a838e2..993456196d 100644--- a/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs+++ b/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Collections.Concurrent;using System.Collections.Generic;diff --git a/Emby.Server.Implementations/TV/TVSeriesManager.cs b/Emby.Server.Implementations/TV/TVSeriesManager.csindex 829df64bfb..a837f09cac 100644--- a/Emby.Server.Implementations/TV/TVSeriesManager.cs+++ b/Emby.Server.Implementations/TV/TVSeriesManager.cs@@ -1,3 +1,5 @@+#nullable disable+#pragma warning disable CS1591using System;diff --git a/Emby.Server.Implementations/Udp/UdpServer.cs b/Emby.Server.Implementations/Udp/UdpServer.csindex db5265e79d..750f001680 100644--- a/Emby.Server.Implementations/Udp/UdpServer.cs+++ b/Emby.Server.Implementations/Udp/UdpServer.cs@@ -1,3 +1,5 @@+#nullable disable+using System;using System.Net;using System.Net.Sockets;diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.csindex 653b1381b9..2351b7d8c6 100644--- a/Emby.Server.Implementations/Updates/InstallationManager.cs+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs@@ -1,3 +1,5 @@+#nullable disable+#nullable enableusing System;diff --git a/Jellyfin.Api/Controllers/DynamicHlsController.cs b/Jellyfin.Api/Controllers/DynamicHlsController.csindex b4154b361e..45559fce9a 100644--- a/Jellyfin.Api/Controllers/DynamicHlsController.cs+++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs@@ -1762,9 +1762,9 @@ namespace Jellyfin.Api.Controllersprivate static FileSystemMetadata? GetLastTranscodingFile(string playlist, string segmentExtension, IFileSystem fileSystem){- var folder = Path.GetDirectoryName(playlist);+ var folder = Path.GetDirectoryName(playlist) ?? throw new ArgumentException("Path can't be a root directory.", nameof(playlist));- var filePrefix = Path.GetFileNameWithoutExtension(playlist) ?? string.Empty;+ var filePrefix = Path.GetFileNameWithoutExtension(playlist);try{diff --git a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs b/Jellyfin.Api/Helpers/TranscodingJobHelper.csindex 0879cbd18f..7cb0159936 100644--- a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs+++ b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs@@ -380,7 +380,9 @@ namespace Jellyfin.Api.Helpers/// <param name="outputFilePath">The output file path.</param>private void DeleteHlsPartialStreamFiles(string outputFilePath){- var directory = Path.GetDirectoryName(outputFilePath);+ var directory = Path.GetDirectoryName(outputFilePath)+ ?? throw new ArgumentException("Path can't be a root directory.", nameof(outputFilePath));+var name = Path.GetFileNameWithoutExtension(outputFilePath);var filesToDelete = _fileSystem.GetFilePaths(directory)diff --git a/Jellyfin.Api/Models/PlaybackDtos/TranscodingThrottler.cs b/Jellyfin.Api/Models/PlaybackDtos/TranscodingThrottler.csindex e33e552edb..7b32d76ba7 100644--- a/Jellyfin.Api/Models/PlaybackDtos/TranscodingThrottler.cs+++ b/Jellyfin.Api/Models/PlaybackDtos/TranscodingThrottler.cs@@ -145,7 +145,8 @@ namespace Jellyfin.Api.Models.PlaybackDtosvar transcodingPositionTicks = job.TranscodingPositionTicks ?? 0;var downloadPositionTicks = job.DownloadPositionTicks ?? 0;- var path = job.Path;+ var path = job.Path ?? throw new ArgumentException("Path can't be null.");+var gapLengthInTicks = TimeSpan.FromSeconds(thresholdSeconds).Ticks;if (downloadPositionTicks > 0 && transcodingPositionTicks > 0)diff --git a/Jellyfin.Server/Migrations/Routines/MigrateUserDb.cs b/Jellyfin.Server/Migrations/Routines/MigrateUserDb.csindex a15a381772..96bd2ccc40 100644--- a/Jellyfin.Server/Migrations/Routines/MigrateUserDb.cs+++ b/Jellyfin.Server/Migrations/Routines/MigrateUserDb.cs@@ -82,11 +82,14 @@ namespace Jellyfin.Server.Migrations.Routinesvar userDataDir = Path.Combine(_paths.UserConfigurationDirectoryPath, mockup.Name);- var config = File.Exists(Path.Combine(userDataDir, "config.xml"))- ? (UserConfiguration)_xmlSerializer.DeserializeFromFile(typeof(UserConfiguration), Path.Combine(userDataDir, "config.xml"))+ var configPath = Path.Combine(userDataDir, "config.xml");+ var config = File.Exists(configPath)+ ? (UserConfiguration?)_xmlSerializer.DeserializeFromFile(typeof(UserConfiguration), configPath) ?? new UserConfiguration(): new UserConfiguration();- var policy = File.Exists(Path.Combine(userDataDir, "policy.xml"))- ? (UserPolicy)_xmlSerializer.DeserializeFromFile(typeof(UserPolicy), Path.Combine(userDataDir, "policy.xml"))++ var policyPath = Path.Combine(userDataDir, "policy.xml");+ var policy = File.Exists(policyPath)+ ? (UserPolicy?)_xmlSerializer.DeserializeFromFile(typeof(UserPolicy), policyPath) ?? new UserPolicy(): new UserPolicy();policy.AuthenticationProviderId = policy.AuthenticationProviderId?.Replace("Emby.Server.Implementations.Library",diff --git a/MediaBrowser.Controller/Extensions/StringExtensions.cs b/MediaBrowser.Controller/Extensions/StringExtensions.csindex 48bd9522a8..1853896eec 100644--- a/MediaBrowser.Controller/Extensions/StringExtensions.cs+++ b/MediaBrowser.Controller/Extensions/StringExtensions.cs@@ -1,6 +1,7 @@#pragma warning disable CS1591using System;+using System.Collections.Generic;using System.Globalization;using System.Linq;using System.Text;diff --git a/MediaBrowser.Controller/Net/ISessionContext.cs b/MediaBrowser.Controller/Net/ISessionContext.csindex a60dc2ea19..6b896b41f4 100644--- a/MediaBrowser.Controller/Net/ISessionContext.cs+++ b/MediaBrowser.Controller/Net/ISessionContext.cs@@ -10,10 +10,10 @@ namespace MediaBrowser.Controller.Net{SessionInfo GetSession(object requestContext);- User GetUser(object requestContext);+ User? GetUser(object requestContext);SessionInfo GetSession(HttpContext requestContext);- User GetUser(HttpContext requestContext);+ User? GetUser(HttpContext requestContext);}}diff --git a/MediaBrowser.Controller/Sorting/IBaseItemComparer.cs b/MediaBrowser.Controller/Sorting/IBaseItemComparer.csindex 727cbe639c..07fe1ea8a9 100644--- a/MediaBrowser.Controller/Sorting/IBaseItemComparer.cs+++ b/MediaBrowser.Controller/Sorting/IBaseItemComparer.cs@@ -6,7 +6,7 @@ namespace MediaBrowser.Controller.Sorting/// <summary>/// Interface IBaseItemComparer./// </summary>- public interface IBaseItemComparer : IComparer<BaseItem>+ public interface IBaseItemComparer : IComparer<BaseItem?>{/// <summary>/// Gets the name.diff --git a/MediaBrowser.Model/IO/IFileSystem.cs b/MediaBrowser.Model/IO/IFileSystem.csindex e5c26430a8..be4f1e16b5 100644--- a/MediaBrowser.Model/IO/IFileSystem.cs+++ b/MediaBrowser.Model/IO/IFileSystem.cs@@ -1,4 +1,3 @@-#nullable disable#pragma warning disable CS1591using System;@@ -25,7 +24,7 @@ namespace MediaBrowser.Model.IO/// </summary>/// <param name="filename">The filename.</param>/// <returns>System.String.</returns>- string ResolveShortcut(string filename);+ string? ResolveShortcut(string filename);/// <summary>/// Creates the shortcut.@@ -160,7 +159,7 @@ namespace MediaBrowser.Model.IO/// <returns>All found files.</returns>IEnumerable<FileSystemMetadata> GetFiles(string path, bool recursive = false);- IEnumerable<FileSystemMetadata> GetFiles(string path, IReadOnlyList<string> extensions, bool enableCaseSensitiveExtensions, bool recursive);+ IEnumerable<FileSystemMetadata> GetFiles(string path, IReadOnlyList<string>? extensions, bool enableCaseSensitiveExtensions, bool recursive);/// <summary>/// Gets the file system entries.@@ -186,7 +185,7 @@ namespace MediaBrowser.Model.IO/// <returns>IEnumerable<System.String>.</returns>IEnumerable<string> GetFilePaths(string path, bool recursive = false);- IEnumerable<string> GetFilePaths(string path, string[] extensions, bool enableCaseSensitiveExtensions, bool recursive);+ IEnumerable<string> GetFilePaths(string path, string[]? extensions, bool enableCaseSensitiveExtensions, bool recursive);/// <summary>/// Gets the file system entry paths.diff --git a/MediaBrowser.Model/IO/IShortcutHandler.cs b/MediaBrowser.Model/IO/IShortcutHandler.csindex 14d5c4b62f..2c364a962f 100644--- a/MediaBrowser.Model/IO/IShortcutHandler.cs+++ b/MediaBrowser.Model/IO/IShortcutHandler.cs@@ -15,7 +15,7 @@ namespace MediaBrowser.Model.IO/// </summary>/// <param name="shortcutPath">The shortcut path.</param>/// <returns>System.String.</returns>- string Resolve(string shortcutPath);+ string? Resolve(string shortcutPath);/// <summary>/// Creates the specified shortcut path.diff --git a/MediaBrowser.Model/IO/IStreamHelper.cs b/MediaBrowser.Model/IO/IStreamHelper.csindex 0e09db16e8..f900da5567 100644--- a/MediaBrowser.Model/IO/IStreamHelper.cs+++ b/MediaBrowser.Model/IO/IStreamHelper.cs@@ -9,7 +9,7 @@ namespace MediaBrowser.Model.IO{public interface IStreamHelper{- Task CopyToAsync(Stream source, Stream destination, int bufferSize, Action onStarted, CancellationToken cancellationToken);+ Task CopyToAsync(Stream source, Stream destination, int bufferSize, Action? onStarted, CancellationToken cancellationToken);Task CopyToAsync(Stream source, Stream destination, int bufferSize, int emptyReadLimit, CancellationToken cancellationToken);diff --git a/MediaBrowser.Model/Tasks/ITaskTrigger.cs b/MediaBrowser.Model/Tasks/ITaskTrigger.csindex cbd60cca18..db9fba6964 100644--- a/MediaBrowser.Model/Tasks/ITaskTrigger.cs+++ b/MediaBrowser.Model/Tasks/ITaskTrigger.cs@@ -11,7 +11,7 @@ namespace MediaBrowser.Model.Tasks/// <summary>/// Fires when the trigger condition is satisfied and the task should run./// </summary>- event EventHandler<EventArgs> Triggered;+ event EventHandler<EventArgs>? Triggered;/// <summary>/// Gets or sets the options of this task.