The Free Software Media System - Server Backend & API
Update StyleCop
Bond_009cbfa355e31ec
diff --git a/Directory.Build.props b/Directory.Build.propsindex d243cde2b7..b27782918c 100644--- a/Directory.Build.props+++ b/Directory.Build.props@@ -6,7 +6,7 @@<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)/jellyfin.ruleset</CodeAnalysisRuleSet></PropertyGroup>- <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">+ <PropertyGroup><TreatWarningsAsErrors>true</TreatWarningsAsErrors></PropertyGroup>diff --git a/Emby.Dlna/ContentDirectory/ControlHandler.cs b/Emby.Dlna/ContentDirectory/ControlHandler.csindex fde3f2f893..010f90c624 100644--- a/Emby.Dlna/ContentDirectory/ControlHandler.cs+++ b/Emby.Dlna/ContentDirectory/ControlHandler.cs@@ -690,16 +690,16 @@ namespace Emby.Dlna.ContentDirectoryvar serverItems = new ServerItem[]{- new (item, StubType.Latest),- new (item, StubType.Playlists),- new (item, StubType.Albums),- new (item, StubType.AlbumArtists),- new (item, StubType.Artists),- new (item, StubType.Songs),- new (item, StubType.Genres),- new (item, StubType.FavoriteArtists),- new (item, StubType.FavoriteAlbums),- new (item, StubType.FavoriteSongs)+ new(item, StubType.Latest),+ new(item, StubType.Playlists),+ new(item, StubType.Albums),+ new(item, StubType.AlbumArtists),+ new(item, StubType.Artists),+ new(item, StubType.Songs),+ new(item, StubType.Genres),+ new(item, StubType.FavoriteArtists),+ new(item, StubType.FavoriteAlbums),+ new(item, StubType.FavoriteSongs)};if (limit < serverItems.Length)@@ -751,12 +751,12 @@ namespace Emby.Dlna.ContentDirectoryvar array = new ServerItem[]{- new (item, StubType.ContinueWatching),- new (item, StubType.Latest),- new (item, StubType.Movies),- new (item, StubType.Collections),- new (item, StubType.Favorites),- new (item, StubType.Genres)+ new(item, StubType.ContinueWatching),+ new(item, StubType.Latest),+ new(item, StubType.Movies),+ new(item, StubType.Collections),+ new(item, StubType.Favorites),+ new(item, StubType.Genres)};if (limit < array.Length)@@ -836,13 +836,13 @@ namespace Emby.Dlna.ContentDirectoryvar serverItems = new ServerItem[]{- new (item, StubType.ContinueWatching),- new (item, StubType.NextUp),- new (item, StubType.Latest),- new (item, StubType.Series),- new (item, StubType.FavoriteSeries),- new (item, StubType.FavoriteEpisodes),- new (item, StubType.Genres)+ new(item, StubType.ContinueWatching),+ new(item, StubType.NextUp),+ new(item, StubType.Latest),+ new(item, StubType.Series),+ new(item, StubType.FavoriteSeries),+ new(item, StubType.FavoriteEpisodes),+ new(item, StubType.Genres)};if (limit < serverItems.Length)diff --git a/Emby.Dlna/Emby.Dlna.csproj b/Emby.Dlna/Emby.Dlna.csprojindex 7fdbd44f00..fd95041fe7 100644--- a/Emby.Dlna/Emby.Dlna.csproj+++ b/Emby.Dlna/Emby.Dlna.csproj@@ -22,10 +22,14 @@<GenerateDocumentationFile>true</GenerateDocumentationFile></PropertyGroup>+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>+ </PropertyGroup>+<!-- Code Analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/Emby.Drawing/Emby.Drawing.csproj b/Emby.Drawing/Emby.Drawing.csprojindex 149e4b5d91..b9a2c5d5d1 100644--- a/Emby.Drawing/Emby.Drawing.csproj+++ b/Emby.Drawing/Emby.Drawing.csproj@@ -11,6 +11,10 @@<GenerateDocumentationFile>true</GenerateDocumentationFile></PropertyGroup>+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>+ </PropertyGroup>+<ItemGroup><ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" /><ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />@@ -24,7 +28,7 @@<!-- Code analysers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.csindex 3f75e4fc79..8ea711abe2 100644--- a/Emby.Drawing/ImageProcessor.cs+++ b/Emby.Drawing/ImageProcessor.cs@@ -101,8 +101,7 @@ namespace Emby.Drawingpublic async Task ProcessImage(ImageProcessingOptions options, Stream toStream){var file = await ProcessImage(options).ConfigureAwait(false);-- using (var fileStream = AsyncFile.OpenRead(file.Item1))+ using (var fileStream = AsyncFile.OpenRead(file.path)){await fileStream.CopyToAsync(toStream).ConfigureAwait(false);}diff --git a/Emby.Naming/AudioBook/AudioBookListResolver.cs b/Emby.Naming/AudioBook/AudioBookListResolver.csindex dd8a05bb3e..2efe7d526f 100644--- a/Emby.Naming/AudioBook/AudioBookListResolver.cs+++ b/Emby.Naming/AudioBook/AudioBookListResolver.cs@@ -33,7 +33,6 @@ namespace Emby.Naming.AudioBook/// <returns>Returns IEnumerable of <see cref="AudioBookInfo"/>.</returns>public IEnumerable<AudioBookInfo> Resolve(IEnumerable<FileSystemMetadata> files){-// File with empty fullname will be sorted out here.var audiobookFileInfos = files.Select(i => _audioBookResolver.Resolve(i.FullName))diff --git a/Emby.Naming/Emby.Naming.csproj b/Emby.Naming/Emby.Naming.csprojindex 2bf8eacb1b..433ad137b9 100644--- a/Emby.Naming/Emby.Naming.csproj+++ b/Emby.Naming/Emby.Naming.csproj@@ -15,6 +15,10 @@<SymbolPackageFormat>snupkg</SymbolPackageFormat></PropertyGroup>+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>+ </PropertyGroup>+<PropertyGroup Condition=" '$(Stability)'=='Unstable'"><!-- Include all symbols in the main nupkg until Azure Artifact Feed starts supporting ingesting NuGet symbol packages. --><AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>@@ -44,7 +48,7 @@<!-- Code Analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/Emby.Naming/Video/Format3DParser.cs b/Emby.Naming/Video/Format3DParser.csindex 0890899894..eb5e71d78f 100644--- a/Emby.Naming/Video/Format3DParser.cs+++ b/Emby.Naming/Video/Format3DParser.cs@@ -9,7 +9,7 @@ namespace Emby.Naming.Videopublic static class Format3DParser{// Static default result to save on allocation costs.- private static readonly Format3DResult _defaultResult = new (false, null);+ private static readonly Format3DResult _defaultResult = new(false, null);/// <summary>/// Parse 3D format related flags.diff --git a/Emby.Notifications/Emby.Notifications.csproj b/Emby.Notifications/Emby.Notifications.csprojindex d200682e65..7fd2e9bb40 100644--- a/Emby.Notifications/Emby.Notifications.csproj+++ b/Emby.Notifications/Emby.Notifications.csproj@@ -24,7 +24,7 @@<!-- Code analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/Emby.Photos/Emby.Photos.csproj b/Emby.Photos/Emby.Photos.csprojindex bf6252c195..4964265c9f 100644--- a/Emby.Photos/Emby.Photos.csproj+++ b/Emby.Photos/Emby.Photos.csproj@@ -26,7 +26,7 @@<!-- Code Analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' ">- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.csindex 8892f7f40f..8ed51a1949 100644--- a/Emby.Server.Implementations/ApplicationHost.cs+++ b/Emby.Server.Implementations/ApplicationHost.cs@@ -120,7 +120,7 @@ namespace Emby.Server.Implementations/// <summary>/// The disposable parts./// </summary>- private readonly ConcurrentDictionary<IDisposable, byte> _disposableParts = new ();+ private readonly ConcurrentDictionary<IDisposable, byte> _disposableParts = new();private readonly IFileSystem _fileSystemManager;private readonly IConfiguration _startupConfig;diff --git a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs b/Emby.Server.Implementations/Data/BaseSqliteRepository.csindex 5030cbacb8..450688491a 100644--- a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs+++ b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs@@ -160,21 +160,22 @@ namespace Emby.Server.Implementations.Dataprotected bool TableExists(ManagedConnection connection, string name){return connection.RunInTransaction(- db =>- {- using (var statement = PrepareStatement(db, "select DISTINCT tbl_name from sqlite_master"))+ db =>{- foreach (var row in statement.ExecuteQuery())+ using (var statement = PrepareStatement(db, "select DISTINCT tbl_name from sqlite_master")){- if (string.Equals(name, row.GetString(0), StringComparison.OrdinalIgnoreCase))+ foreach (var row in statement.ExecuteQuery()){- return true;+ if (string.Equals(name, row.GetString(0), StringComparison.OrdinalIgnoreCase))+ {+ return true;+ }}}- }- return false;- }, ReadTransactionMode);+ return false;+ },+ ReadTransactionMode);}protected List<string> GetColumnNames(IDatabaseConnection connection, string table)diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.csindex beae7e2431..7fafbc9bea 100644--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs@@ -498,109 +498,110 @@ namespace Emby.Server.Implementations.Dataconnection.RunQueries(queries);connection.RunInTransaction(- db =>- {- var existingColumnNames = GetColumnNames(db, "AncestorIds");- AddColumn(db, "AncestorIds", "AncestorIdText", "Text", existingColumnNames);-- existingColumnNames = GetColumnNames(db, "TypedBaseItems");-- AddColumn(db, "TypedBaseItems", "Path", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "StartDate", "DATETIME", existingColumnNames);- AddColumn(db, "TypedBaseItems", "EndDate", "DATETIME", existingColumnNames);- AddColumn(db, "TypedBaseItems", "ChannelId", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "IsMovie", "BIT", existingColumnNames);- AddColumn(db, "TypedBaseItems", "CommunityRating", "Float", existingColumnNames);- AddColumn(db, "TypedBaseItems", "CustomRating", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "IndexNumber", "INT", existingColumnNames);- AddColumn(db, "TypedBaseItems", "IsLocked", "BIT", existingColumnNames);- AddColumn(db, "TypedBaseItems", "Name", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "OfficialRating", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "MediaType", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "Overview", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "ParentIndexNumber", "INT", existingColumnNames);- AddColumn(db, "TypedBaseItems", "PremiereDate", "DATETIME", existingColumnNames);- AddColumn(db, "TypedBaseItems", "ProductionYear", "INT", existingColumnNames);- AddColumn(db, "TypedBaseItems", "ParentId", "GUID", existingColumnNames);- AddColumn(db, "TypedBaseItems", "Genres", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "SortName", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "ForcedSortName", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "RunTimeTicks", "BIGINT", existingColumnNames);- AddColumn(db, "TypedBaseItems", "DateCreated", "DATETIME", existingColumnNames);- AddColumn(db, "TypedBaseItems", "DateModified", "DATETIME", existingColumnNames);- AddColumn(db, "TypedBaseItems", "IsSeries", "BIT", existingColumnNames);- AddColumn(db, "TypedBaseItems", "EpisodeTitle", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "IsRepeat", "BIT", existingColumnNames);- AddColumn(db, "TypedBaseItems", "PreferredMetadataLanguage", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "PreferredMetadataCountryCode", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "DateLastRefreshed", "DATETIME", existingColumnNames);- AddColumn(db, "TypedBaseItems", "DateLastSaved", "DATETIME", existingColumnNames);- AddColumn(db, "TypedBaseItems", "IsInMixedFolder", "BIT", existingColumnNames);- AddColumn(db, "TypedBaseItems", "LockedFields", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "Studios", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "Audio", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "ExternalServiceId", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "Tags", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "IsFolder", "BIT", existingColumnNames);- AddColumn(db, "TypedBaseItems", "InheritedParentalRatingValue", "INT", existingColumnNames);- AddColumn(db, "TypedBaseItems", "UnratedType", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "TopParentId", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "TrailerTypes", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "CriticRating", "Float", existingColumnNames);- AddColumn(db, "TypedBaseItems", "CleanName", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "PresentationUniqueKey", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "OriginalTitle", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "PrimaryVersionId", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "DateLastMediaAdded", "DATETIME", existingColumnNames);- AddColumn(db, "TypedBaseItems", "Album", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "IsVirtualItem", "BIT", existingColumnNames);- AddColumn(db, "TypedBaseItems", "SeriesName", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "UserDataKey", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "SeasonName", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "SeasonId", "GUID", existingColumnNames);- AddColumn(db, "TypedBaseItems", "SeriesId", "GUID", existingColumnNames);- AddColumn(db, "TypedBaseItems", "ExternalSeriesId", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "Tagline", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "ProviderIds", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "Images", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "ProductionLocations", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "ExtraIds", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "TotalBitrate", "INT", existingColumnNames);- AddColumn(db, "TypedBaseItems", "ExtraType", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "Artists", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "AlbumArtists", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "ExternalId", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "SeriesPresentationUniqueKey", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "ShowId", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "OwnerId", "Text", existingColumnNames);- AddColumn(db, "TypedBaseItems", "Width", "INT", existingColumnNames);- AddColumn(db, "TypedBaseItems", "Height", "INT", existingColumnNames);- AddColumn(db, "TypedBaseItems", "Size", "BIGINT", existingColumnNames);-- existingColumnNames = GetColumnNames(db, "ItemValues");- AddColumn(db, "ItemValues", "CleanValue", "Text", existingColumnNames);-- existingColumnNames = GetColumnNames(db, ChaptersTableName);- AddColumn(db, ChaptersTableName, "ImageDateModified", "DATETIME", existingColumnNames);-- existingColumnNames = GetColumnNames(db, "MediaStreams");- AddColumn(db, "MediaStreams", "IsAvc", "BIT", existingColumnNames);- AddColumn(db, "MediaStreams", "TimeBase", "TEXT", existingColumnNames);- AddColumn(db, "MediaStreams", "CodecTimeBase", "TEXT", existingColumnNames);- AddColumn(db, "MediaStreams", "Title", "TEXT", existingColumnNames);- AddColumn(db, "MediaStreams", "NalLengthSize", "TEXT", existingColumnNames);- AddColumn(db, "MediaStreams", "Comment", "TEXT", existingColumnNames);- AddColumn(db, "MediaStreams", "CodecTag", "TEXT", existingColumnNames);- AddColumn(db, "MediaStreams", "PixelFormat", "TEXT", existingColumnNames);- AddColumn(db, "MediaStreams", "BitDepth", "INT", existingColumnNames);- AddColumn(db, "MediaStreams", "RefFrames", "INT", existingColumnNames);- AddColumn(db, "MediaStreams", "KeyFrames", "TEXT", existingColumnNames);- AddColumn(db, "MediaStreams", "IsAnamorphic", "BIT", existingColumnNames);-- AddColumn(db, "MediaStreams", "ColorPrimaries", "TEXT", existingColumnNames);- AddColumn(db, "MediaStreams", "ColorSpace", "TEXT", existingColumnNames);- AddColumn(db, "MediaStreams", "ColorTransfer", "TEXT", existingColumnNames);- }, TransactionMode);+ db =>+ {+ var existingColumnNames = GetColumnNames(db, "AncestorIds");+ AddColumn(db, "AncestorIds", "AncestorIdText", "Text", existingColumnNames);++ existingColumnNames = GetColumnNames(db, "TypedBaseItems");++ AddColumn(db, "TypedBaseItems", "Path", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "StartDate", "DATETIME", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "EndDate", "DATETIME", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "ChannelId", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "IsMovie", "BIT", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "CommunityRating", "Float", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "CustomRating", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "IndexNumber", "INT", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "IsLocked", "BIT", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "Name", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "OfficialRating", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "MediaType", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "Overview", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "ParentIndexNumber", "INT", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "PremiereDate", "DATETIME", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "ProductionYear", "INT", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "ParentId", "GUID", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "Genres", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "SortName", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "ForcedSortName", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "RunTimeTicks", "BIGINT", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "DateCreated", "DATETIME", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "DateModified", "DATETIME", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "IsSeries", "BIT", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "EpisodeTitle", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "IsRepeat", "BIT", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "PreferredMetadataLanguage", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "PreferredMetadataCountryCode", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "DateLastRefreshed", "DATETIME", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "DateLastSaved", "DATETIME", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "IsInMixedFolder", "BIT", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "LockedFields", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "Studios", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "Audio", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "ExternalServiceId", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "Tags", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "IsFolder", "BIT", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "InheritedParentalRatingValue", "INT", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "UnratedType", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "TopParentId", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "TrailerTypes", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "CriticRating", "Float", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "CleanName", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "PresentationUniqueKey", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "OriginalTitle", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "PrimaryVersionId", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "DateLastMediaAdded", "DATETIME", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "Album", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "IsVirtualItem", "BIT", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "SeriesName", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "UserDataKey", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "SeasonName", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "SeasonId", "GUID", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "SeriesId", "GUID", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "ExternalSeriesId", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "Tagline", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "ProviderIds", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "Images", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "ProductionLocations", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "ExtraIds", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "TotalBitrate", "INT", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "ExtraType", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "Artists", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "AlbumArtists", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "ExternalId", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "SeriesPresentationUniqueKey", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "ShowId", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "OwnerId", "Text", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "Width", "INT", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "Height", "INT", existingColumnNames);+ AddColumn(db, "TypedBaseItems", "Size", "BIGINT", existingColumnNames);++ existingColumnNames = GetColumnNames(db, "ItemValues");+ AddColumn(db, "ItemValues", "CleanValue", "Text", existingColumnNames);++ existingColumnNames = GetColumnNames(db, ChaptersTableName);+ AddColumn(db, ChaptersTableName, "ImageDateModified", "DATETIME", existingColumnNames);++ existingColumnNames = GetColumnNames(db, "MediaStreams");+ AddColumn(db, "MediaStreams", "IsAvc", "BIT", existingColumnNames);+ AddColumn(db, "MediaStreams", "TimeBase", "TEXT", existingColumnNames);+ AddColumn(db, "MediaStreams", "CodecTimeBase", "TEXT", existingColumnNames);+ AddColumn(db, "MediaStreams", "Title", "TEXT", existingColumnNames);+ AddColumn(db, "MediaStreams", "NalLengthSize", "TEXT", existingColumnNames);+ AddColumn(db, "MediaStreams", "Comment", "TEXT", existingColumnNames);+ AddColumn(db, "MediaStreams", "CodecTag", "TEXT", existingColumnNames);+ AddColumn(db, "MediaStreams", "PixelFormat", "TEXT", existingColumnNames);+ AddColumn(db, "MediaStreams", "BitDepth", "INT", existingColumnNames);+ AddColumn(db, "MediaStreams", "RefFrames", "INT", existingColumnNames);+ AddColumn(db, "MediaStreams", "KeyFrames", "TEXT", existingColumnNames);+ AddColumn(db, "MediaStreams", "IsAnamorphic", "BIT", existingColumnNames);++ AddColumn(db, "MediaStreams", "ColorPrimaries", "TEXT", existingColumnNames);+ AddColumn(db, "MediaStreams", "ColorSpace", "TEXT", existingColumnNames);+ AddColumn(db, "MediaStreams", "ColorTransfer", "TEXT", existingColumnNames);+ },+ TransactionMode);connection.RunQueries(postQueries);}@@ -636,16 +637,17 @@ namespace Emby.Server.Implementations.Datausing (var connection = GetConnection()){connection.RunInTransaction(- db =>- {- using (var saveImagesStatement = PrepareStatement(db, "Update TypedBaseItems set Images=@Images where guid=@Id"))+ db =>{- saveImagesStatement.TryBind("@Id", item.Id.ToByteArray());- saveImagesStatement.TryBind("@Images", SerializeImages(item.ImageInfos));+ using (var saveImagesStatement = PrepareStatement(db, "Update TypedBaseItems set Images=@Images where guid=@Id"))+ {+ saveImagesStatement.TryBind("@Id", item.Id.ToByteArray());+ saveImagesStatement.TryBind("@Images", SerializeImages(item.ImageInfos));- saveImagesStatement.MoveNext();- }- }, TransactionMode);+ saveImagesStatement.MoveNext();+ }+ },+ TransactionMode);}}@@ -686,10 +688,11 @@ namespace Emby.Server.Implementations.Datausing (var connection = GetConnection()){connection.RunInTransaction(- db =>- {- SaveItemsInTranscation(db, tuples);- }, TransactionMode);+ db =>+ {+ SaveItemsInTranscation(db, tuples);+ },+ TransactionMode);}}@@ -2134,13 +2137,14 @@ namespace Emby.Server.Implementations.Datausing (var connection = GetConnection()){connection.RunInTransaction(- db =>- {- // First delete chapters- db.Execute("delete from " + ChaptersTableName + " where ItemId=@ItemId", idBlob);+ db =>+ {+ // First delete chapters+ db.Execute("delete from " + ChaptersTableName + " where ItemId=@ItemId", idBlob);- InsertChapters(idBlob, chapters, db);- }, TransactionMode);+ InsertChapters(idBlob, chapters, db);+ },+ TransactionMode);}}@@ -2944,69 +2948,70 @@ namespace Emby.Server.Implementations.Datausing (var connection = GetConnection(true)){connection.RunInTransaction(- db =>- {- var itemQueryStatement = PrepareStatement(db, itemQuery);- var totalRecordCountQueryStatement = PrepareStatement(db, totalRecordCountQuery);-- if (!isReturningZeroItems)+ db =>{- using (var statement = itemQueryStatement)+ var itemQueryStatement = PrepareStatement(db, itemQuery);+ var totalRecordCountQueryStatement = PrepareStatement(db, totalRecordCountQuery);++ if (!isReturningZeroItems){- if (EnableJoinUserData(query))+ using (var statement = itemQueryStatement){- statement.TryBind("@UserId", query.User.InternalId);- }+ if (EnableJoinUserData(query))+ {+ statement.TryBind("@UserId", query.User.InternalId);+ }- BindSimilarParams(query, statement);- BindSearchParams(query, statement);+ BindSimilarParams(query, statement);+ BindSearchParams(query, statement);- // Running this again will bind the params- GetWhereClauses(query, statement);+ // Running this again will bind the params+ GetWhereClauses(query, statement);- var hasEpisodeAttributes = HasEpisodeAttributes(query);- var hasServiceName = HasServiceName(query);- var hasProgramAttributes = HasProgramAttributes(query);- var hasStartDate = HasStartDate(query);- var hasTrailerTypes = HasTrailerTypes(query);- var hasArtistFields = HasArtistFields(query);- var hasSeriesFields = HasSeriesFields(query);+ var hasEpisodeAttributes = HasEpisodeAttributes(query);+ var hasServiceName = HasServiceName(query);+ var hasProgramAttributes = HasProgramAttributes(query);+ var hasStartDate = HasStartDate(query);+ var hasTrailerTypes = HasTrailerTypes(query);+ var hasArtistFields = HasArtistFields(query);+ var hasSeriesFields = HasSeriesFields(query);- foreach (var row in statement.ExecuteQuery())- {- var item = GetItem(row, query, hasProgramAttributes, hasEpisodeAttributes, hasServiceName, hasStartDate, hasTrailerTypes, hasArtistFields, hasSeriesFields);- if (item != null)+ foreach (var row in statement.ExecuteQuery()){- list.Add(item);+ var item = GetItem(row, query, hasProgramAttributes, hasEpisodeAttributes, hasServiceName, hasStartDate, hasTrailerTypes, hasArtistFields, hasSeriesFields);+ if (item != null)+ {+ list.Add(item);+ }}}- }- LogQueryTime("GetItems.ItemQuery", itemQuery, now);- }+ LogQueryTime("GetItems.ItemQuery", itemQuery, now);+ }- now = DateTime.UtcNow;- if (query.EnableTotalRecordCount)- {- using (var statement = totalRecordCountQueryStatement)+ now = DateTime.UtcNow;+ if (query.EnableTotalRecordCount){- if (EnableJoinUserData(query))+ using (var statement = totalRecordCountQueryStatement){- statement.TryBind("@UserId", query.User.InternalId);- }+ if (EnableJoinUserData(query))+ {+ statement.TryBind("@UserId", query.User.InternalId);+ }- BindSimilarParams(query, statement);- BindSearchParams(query, statement);+ BindSimilarParams(query, statement);+ BindSearchParams(query, statement);- // Running this again will bind the params- GetWhereClauses(query, statement);+ // Running this again will bind the params+ GetWhereClauses(query, statement);- result.TotalRecordCount = statement.ExecuteQuery().SelectScalarInt().First();- }+ result.TotalRecordCount = statement.ExecuteQuery().SelectScalarInt().First();+ }- LogQueryTime("GetItems.TotalRecordCount", totalRecordCountQuery, now);- }- }, ReadTransactionMode);+ LogQueryTime("GetItems.TotalRecordCount", totalRecordCountQuery, now);+ }+ },+ ReadTransactionMode);}result.Items = list;@@ -3363,51 +3368,52 @@ namespace Emby.Server.Implementations.Datausing (var connection = GetConnection(true)){connection.RunInTransaction(- db =>- {- var statements = PrepareAll(db, statementTexts);-- if (!isReturningZeroItems)+ db =>{- using (var statement = statements[0])+ var statements = PrepareAll(db, statementTexts);++ if (!isReturningZeroItems){- if (EnableJoinUserData(query))+ using (var statement = statements[0]){- statement.TryBind("@UserId", query.User.InternalId);- }+ if (EnableJoinUserData(query))+ {+ statement.TryBind("@UserId", query.User.InternalId);+ }- BindSimilarParams(query, statement);- BindSearchParams(query, statement);+ BindSimilarParams(query, statement);+ BindSearchParams(query, statement);- // Running this again will bind the params- GetWhereClauses(query, statement);+ // Running this again will bind the params+ GetWhereClauses(query, statement);- foreach (var row in statement.ExecuteQuery())- {- list.Add(row[0].ReadGuidFromBlob());+ foreach (var row in statement.ExecuteQuery())+ {+ list.Add(row[0].ReadGuidFromBlob());+ }}}- }- if (query.EnableTotalRecordCount)- {- using (var statement = statements[statements.Length - 1])+ if (query.EnableTotalRecordCount){- if (EnableJoinUserData(query))+ using (var statement = statements[statements.Length - 1]){- statement.TryBind("@UserId", query.User.InternalId);- }+ if (EnableJoinUserData(query))+ {+ statement.TryBind("@UserId", query.User.InternalId);+ }- BindSimilarParams(query, statement);- BindSearchParams(query, statement);+ BindSimilarParams(query, statement);+ BindSearchParams(query, statement);- // Running this again will bind the params- GetWhereClauses(query, statement);+ // Running this again will bind the params+ GetWhereClauses(query, statement);- result.TotalRecordCount = statement.ExecuteQuery().SelectScalarInt().First();+ result.TotalRecordCount = statement.ExecuteQuery().SelectScalarInt().First();+ }}- }- }, ReadTransactionMode);+ },+ ReadTransactionMode);}LogQueryTime("GetItemIds", commandText, now);@@ -4954,10 +4960,11 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Typeusing (var connection = GetConnection()){connection.RunInTransaction(- db =>- {- connection.ExecuteAll(sql);- }, TransactionMode);+ db =>+ {+ connection.ExecuteAll(sql);+ },+ TransactionMode);}}@@ -4988,28 +4995,29 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Typeusing (var connection = GetConnection()){connection.RunInTransaction(- db =>- {- var idBlob = id.ToByteArray();+ db =>+ {+ var idBlob = id.ToByteArray();- // Delete people- ExecuteWithSingleParam(db, "delete from People where ItemId=@Id", idBlob);+ // Delete people+ ExecuteWithSingleParam(db, "delete from People where ItemId=@Id", idBlob);- // Delete chapters- ExecuteWithSingleParam(db, "delete from " + ChaptersTableName + " where ItemId=@Id", idBlob);+ // Delete chapters+ ExecuteWithSingleParam(db, "delete from " + ChaptersTableName + " where ItemId=@Id", idBlob);- // Delete media streams- ExecuteWithSingleParam(db, "delete from mediastreams where ItemId=@Id", idBlob);+ // Delete media streams+ ExecuteWithSingleParam(db, "delete from mediastreams where ItemId=@Id", idBlob);- // Delete ancestors- ExecuteWithSingleParam(db, "delete from AncestorIds where ItemId=@Id", idBlob);+ // Delete ancestors+ ExecuteWithSingleParam(db, "delete from AncestorIds where ItemId=@Id", idBlob);- // Delete item values- ExecuteWithSingleParam(db, "delete from ItemValues where ItemId=@Id", idBlob);+ // Delete item values+ ExecuteWithSingleParam(db, "delete from ItemValues where ItemId=@Id", idBlob);- // Delete the item- ExecuteWithSingleParam(db, "delete from TypedBaseItems where guid=@Id", idBlob);- }, TransactionMode);+ // Delete the item+ ExecuteWithSingleParam(db, "delete from TypedBaseItems where guid=@Id", idBlob);+ },+ TransactionMode);}}@@ -5808,15 +5816,16 @@ AND Type = @InternalPersonType)");using (var connection = GetConnection()){connection.RunInTransaction(- db =>- {- var itemIdBlob = itemId.ToByteArray();+ db =>+ {+ var itemIdBlob = itemId.ToByteArray();- // First delete chapters- db.Execute("delete from People where ItemId=@ItemId", itemIdBlob);+ // First delete chapters+ db.Execute("delete from People where ItemId=@ItemId", itemIdBlob);- InsertPeople(itemIdBlob, people, db);- }, TransactionMode);+ InsertPeople(itemIdBlob, people, db);+ },+ TransactionMode);}}@@ -5974,7 +5983,8 @@ AND Type = @InternalPersonType)");db.Execute("delete from mediastreams where ItemId=@ItemId", itemIdBlob);InsertMediaStreams(itemIdBlob, streams, db);- }, TransactionMode);+ },+ TransactionMode);}}@@ -6308,7 +6318,8 @@ AND Type = @InternalPersonType)");db.Execute("delete from mediaattachments where ItemId=@ItemId", itemIdBlob);InsertMediaAttachments(itemIdBlob, attachments, db, cancellationToken);- }, TransactionMode);+ },+ TransactionMode);}}diff --git a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs b/Emby.Server.Implementations/Data/SqliteUserDataRepository.csindex 107096b5f2..80b8f9ebff 100644--- a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs+++ b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs@@ -50,41 +50,42 @@ namespace Emby.Server.Implementations.Datavar users = userDatasTableExists ? null : userManager.Users;connection.RunInTransaction(- db =>- {- db.ExecuteAll(string.Join(';', new[]- {- "create table if not exists UserDatas (key nvarchar not null, userId INT not null, rating float null, played bit not null, playCount int not null, isFavorite bit not null, playbackPositionTicks bigint not null, lastPlayedDate datetime null, AudioStreamIndex INT, SubtitleStreamIndex INT)",-- "drop index if exists idx_userdata",- "drop index if exists idx_userdata1",- "drop index if exists idx_userdata2",- "drop index if exists userdataindex1",- "drop index if exists userdataindex",- "drop index if exists userdataindex3",- "drop index if exists userdataindex4",- "create unique index if not exists UserDatasIndex1 on UserDatas (key, userId)",- "create index if not exists UserDatasIndex2 on UserDatas (key, userId, played)",- "create index if not exists UserDatasIndex3 on UserDatas (key, userId, playbackPositionTicks)",- "create index if not exists UserDatasIndex4 on UserDatas (key, userId, isFavorite)"- }));-- if (userDataTableExists)+ db =>{- var existingColumnNames = GetColumnNames(db, "userdata");+ db.ExecuteAll(string.Join(';', new[]+ {+ "create table if not exists UserDatas (key nvarchar not null, userId INT not null, rating float null, played bit not null, playCount int not null, isFavorite bit not null, playbackPositionTicks bigint not null, lastPlayedDate datetime null, AudioStreamIndex INT, SubtitleStreamIndex INT)",++ "drop index if exists idx_userdata",+ "drop index if exists idx_userdata1",+ "drop index if exists idx_userdata2",+ "drop index if exists userdataindex1",+ "drop index if exists userdataindex",+ "drop index if exists userdataindex3",+ "drop index if exists userdataindex4",+ "create unique index if not exists UserDatasIndex1 on UserDatas (key, userId)",+ "create index if not exists UserDatasIndex2 on UserDatas (key, userId, played)",+ "create index if not exists UserDatasIndex3 on UserDatas (key, userId, playbackPositionTicks)",+ "create index if not exists UserDatasIndex4 on UserDatas (key, userId, isFavorite)"+ }));++ if (userDataTableExists)+ {+ var existingColumnNames = GetColumnNames(db, "userdata");- AddColumn(db, "userdata", "InternalUserId", "int", existingColumnNames);- AddColumn(db, "userdata", "AudioStreamIndex", "int", existingColumnNames);- AddColumn(db, "userdata", "SubtitleStreamIndex", "int", existingColumnNames);+ AddColumn(db, "userdata", "InternalUserId", "int", existingColumnNames);+ AddColumn(db, "userdata", "AudioStreamIndex", "int", existingColumnNames);+ AddColumn(db, "userdata", "SubtitleStreamIndex", "int", existingColumnNames);- if (!userDatasTableExists)- {- ImportUserIds(db, users);+ if (!userDatasTableExists)+ {+ ImportUserIds(db, users);- db.ExecuteAll("INSERT INTO UserDatas (key, userId, rating, played, playCount, isFavorite, playbackPositionTicks, lastPlayedDate, AudioStreamIndex, SubtitleStreamIndex) SELECT key, InternalUserId, rating, played, playCount, isFavorite, playbackPositionTicks, lastPlayedDate, AudioStreamIndex, SubtitleStreamIndex from userdata where InternalUserId not null");+ db.ExecuteAll("INSERT INTO UserDatas (key, userId, rating, played, playCount, isFavorite, playbackPositionTicks, lastPlayedDate, AudioStreamIndex, SubtitleStreamIndex) SELECT key, InternalUserId, rating, played, playCount, isFavorite, playbackPositionTicks, lastPlayedDate, AudioStreamIndex, SubtitleStreamIndex from userdata where InternalUserId not null");+ }}- }- }, TransactionMode);+ },+ TransactionMode);}}@@ -183,10 +184,11 @@ namespace Emby.Server.Implementations.Datausing (var connection = GetConnection()){connection.RunInTransaction(- db =>- {- SaveUserData(db, internalUserId, key, userData);- }, TransactionMode);+ db =>+ {+ SaveUserData(db, internalUserId, key, userData);+ },+ TransactionMode);}}@@ -252,13 +254,14 @@ namespace Emby.Server.Implementations.Datausing (var connection = GetConnection()){connection.RunInTransaction(- db =>- {- foreach (var userItemData in userDataList)+ db =>{- SaveUserData(db, internalUserId, userItemData.Key, userItemData);- }- }, TransactionMode);+ foreach (var userItemData in userDataList)+ {+ SaveUserData(db, internalUserId, userItemData.Key, userItemData);+ }+ },+ TransactionMode);}}diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csprojindex 329a84acb9..1e09a98cfb 100644--- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj+++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj@@ -49,10 +49,14 @@<NoWarn>AD0001</NoWarn></PropertyGroup>+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>+ </PropertyGroup>+<!-- Code Analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs b/Emby.Server.Implementations/HttpServer/WebSocketConnection.csindex 0eca2a6080..b3bd3421ab 100644--- a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs+++ b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs@@ -236,7 +236,8 @@ namespace Emby.Server.Implementations.HttpServer{MessageId = Guid.NewGuid(),MessageType = SessionMessageType.KeepAlive- }, CancellationToken.None);+ },+ CancellationToken.None);}/// <inheritdoc />diff --git a/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs b/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.csindex e52b430500..bc2915db62 100644--- a/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs@@ -34,7 +34,6 @@ namespace Emby.Server.Implementations.Library.Resolvers"default"};-public PhotoResolver(IImageProcessor imageProcessor, NamingOptions namingOptions){_imageProcessor = imageProcessor;diff --git a/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs b/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.csindex 73e58d16c3..88b93a2115 100644--- a/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs+++ b/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs@@ -1,16 +1,16 @@using System;+using System.Collections.Generic;using System.Linq;using System.Threading;using System.Threading.Tasks;-using System.Collections.Generic;+using Jellyfin.Data.Enums;using MediaBrowser.Controller.Collections;using MediaBrowser.Controller.Entities;using MediaBrowser.Controller.Entities.Movies;using MediaBrowser.Controller.Library;+using MediaBrowser.Model.Entities;using MediaBrowser.Model.Querying;-using Jellyfin.Data.Enums;using Microsoft.Extensions.Logging;-using MediaBrowser.Model.Entities;namespace Emby.Server.Implementations.Library.Validators{diff --git a/Emby.Server.Implementations/QuickConnect/QuickConnectManager.cs b/Emby.Server.Implementations/QuickConnect/QuickConnectManager.csindex c81c269945..532c8d1e3e 100644--- a/Emby.Server.Implementations/QuickConnect/QuickConnectManager.cs+++ b/Emby.Server.Implementations/QuickConnect/QuickConnectManager.cs@@ -30,8 +30,8 @@ namespace Emby.Server.Implementations.QuickConnect/// </summary>private const int Timeout = 10;- private readonly ConcurrentDictionary<string, QuickConnectResult> _currentRequests = new ();- private readonly ConcurrentDictionary<string, (DateTime Timestamp, AuthenticationResult AuthenticationResult)> _authorizedSecrets = new ();+ private readonly ConcurrentDictionary<string, QuickConnectResult> _currentRequests = new();+ private readonly ConcurrentDictionary<string, (DateTime Timestamp, AuthenticationResult AuthenticationResult)> _authorizedSecrets = new();private readonly IServerConfigurationManager _config;private readonly ILogger<QuickConnectManager> _logger;diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.csindex d10a24bbc6..6c679ea20f 100644--- a/Emby.Server.Implementations/Session/SessionManager.cs+++ b/Emby.Server.Implementations/Session/SessionManager.cs@@ -60,7 +60,7 @@ namespace Emby.Server.Implementations.Session/// <summary>/// The active connections./// </summary>- private readonly ConcurrentDictionary<string, SessionInfo> _activeConnections = new (StringComparer.OrdinalIgnoreCase);+ private readonly ConcurrentDictionary<string, SessionInfo> _activeConnections = new(StringComparer.OrdinalIgnoreCase);private Timer _idleTimer;diff --git a/Emby.Server.Implementations/TV/TVSeriesManager.cs b/Emby.Server.Implementations/TV/TVSeriesManager.csindex a878312944..5dbe9f44d7 100644--- a/Emby.Server.Implementations/TV/TVSeriesManager.cs+++ b/Emby.Server.Implementations/TV/TVSeriesManager.cs@@ -122,7 +122,8 @@ namespace Emby.Server.Implementations.TVLimit = limit,DtoOptions = new DtoOptions { Fields = new[] { ItemFields.SeriesPresentationUniqueKey }, EnableImages = false },GroupBySeriesPresentationUniqueKey = true- }, parentsFolders.ToList())+ },+ parentsFolders.ToList()).Cast<Episode>().Where(episode => !string.IsNullOrEmpty(episode.SeriesPresentationUniqueKey)).Select(GetUniqueSeriesKey);diff --git a/Jellyfin.Api/Controllers/ItemLookupController.cs b/Jellyfin.Api/Controllers/ItemLookupController.csindex 8a6f9b8c75..4161e43f6a 100644--- a/Jellyfin.Api/Controllers/ItemLookupController.cs+++ b/Jellyfin.Api/Controllers/ItemLookupController.cs@@ -264,7 +264,8 @@ namespace Jellyfin.Api.ControllersReplaceAllMetadata = true,ReplaceAllImages = replaceAllImages,SearchResult = searchResult- }, CancellationToken.None).ConfigureAwait(false);+ },+ CancellationToken.None).ConfigureAwait(false);return NoContent();}diff --git a/Jellyfin.Api/Controllers/LiveTvController.cs b/Jellyfin.Api/Controllers/LiveTvController.csindex b131530c93..9e2ef8c604 100644--- a/Jellyfin.Api/Controllers/LiveTvController.cs+++ b/Jellyfin.Api/Controllers/LiveTvController.cs@@ -278,25 +278,26 @@ namespace Jellyfin.Api.Controllersreturn _liveTvManager.GetRecordings(new RecordingQuery- {- ChannelId = channelId,- UserId = userId ?? Guid.Empty,- StartIndex = startIndex,- Limit = limit,- Status = status,- SeriesTimerId = seriesTimerId,- IsInProgress = isInProgress,- EnableTotalRecordCount = enableTotalRecordCount,- IsMovie = isMovie,- IsNews = isNews,- IsSeries = isSeries,- IsKids = isKids,- IsSports = isSports,- IsLibraryItem = isLibraryItem,- Fields = fields,- ImageTypeLimit = imageTypeLimit,- EnableImages = enableImages- }, dtoOptions);+ {+ ChannelId = channelId,+ UserId = userId ?? Guid.Empty,+ StartIndex = startIndex,+ Limit = limit,+ Status = status,+ SeriesTimerId = seriesTimerId,+ IsInProgress = isInProgress,+ EnableTotalRecordCount = enableTotalRecordCount,+ IsMovie = isMovie,+ IsNews = isNews,+ IsSeries = isSeries,+ IsKids = isKids,+ IsSports = isSports,+ IsLibraryItem = isLibraryItem,+ Fields = fields,+ ImageTypeLimit = imageTypeLimit,+ EnableImages = enableImages+ },+ dtoOptions);}/// <summary>@@ -489,14 +490,14 @@ namespace Jellyfin.Api.Controllers[FromQuery] bool? isScheduled){return await _liveTvManager.GetTimers(- new TimerQuery- {- ChannelId = channelId,- SeriesTimerId = seriesTimerId,- IsActive = isActive,- IsScheduled = isScheduled- }, CancellationToken.None)- .ConfigureAwait(false);+ new TimerQuery+ {+ ChannelId = channelId,+ SeriesTimerId = seriesTimerId,+ IsActive = isActive,+ IsScheduled = isScheduled+ },+ CancellationToken.None).ConfigureAwait(false);}/// <summary>@@ -867,7 +868,8 @@ namespace Jellyfin.Api.Controllers{SortOrder = sortOrder ?? SortOrder.Ascending,SortBy = sortBy- }, CancellationToken.None).ConfigureAwait(false);+ },+ CancellationToken.None).ConfigureAwait(false);}/// <summary>diff --git a/Jellyfin.Api/Controllers/RemoteImageController.cs b/Jellyfin.Api/Controllers/RemoteImageController.csindex 9f57a5cdb6..dbee56e140 100644--- a/Jellyfin.Api/Controllers/RemoteImageController.cs+++ b/Jellyfin.Api/Controllers/RemoteImageController.cs@@ -80,7 +80,8 @@ namespace Jellyfin.Api.ControllersIncludeAllLanguages = includeAllLanguages,IncludeDisabledProviders = true,ImageType = type- }, CancellationToken.None)+ },+ CancellationToken.None).ConfigureAwait(false);var imageArray = images.ToArray();diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.csindex f6fbdc3025..8b99170d9e 100644--- a/Jellyfin.Api/Controllers/UserLibraryController.cs+++ b/Jellyfin.Api/Controllers/UserLibraryController.cs@@ -301,7 +301,8 @@ namespace Jellyfin.Api.ControllersLimit = limit,ParentId = parentId ?? Guid.Empty,UserId = userId,- }, dtoOptions);+ },+ dtoOptions);var dtos = list.Select(i =>{diff --git a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs b/Jellyfin.Api/Helpers/TranscodingJobHelper.csindex 9d80070ebf..3526d56c66 100644--- a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs+++ b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs@@ -218,7 +218,8 @@ namespace Jellyfin.Api.Helpersreturn KillTranscodingJobs(j => string.IsNullOrWhiteSpace(playSessionId)? string.Equals(deviceId, j.DeviceId, StringComparison.OrdinalIgnoreCase)- : string.Equals(playSessionId, j.PlaySessionId, StringComparison.OrdinalIgnoreCase), deleteFiles);+ : string.Equals(playSessionId, j.PlaySessionId, StringComparison.OrdinalIgnoreCase),+ deleteFiles);}/// <summary>diff --git a/Jellyfin.Api/Jellyfin.Api.csproj b/Jellyfin.Api/Jellyfin.Api.csprojindex ccd647ebec..b5af074081 100644--- a/Jellyfin.Api/Jellyfin.Api.csproj+++ b/Jellyfin.Api/Jellyfin.Api.csproj@@ -12,6 +12,10 @@<NoWarn>AD0001</NoWarn></PropertyGroup>+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>+ </PropertyGroup>+<ItemGroup><PackageReference Include="Microsoft.AspNetCore.Authorization" Version="6.0.1" /><PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />@@ -27,7 +31,7 @@<!-- Code Analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/Jellyfin.Api/ModelBinders/NullableEnumModelBinderProvider.cs b/Jellyfin.Api/ModelBinders/NullableEnumModelBinderProvider.csindex bc12ad05da..2ccfd0c06e 100644--- a/Jellyfin.Api/ModelBinders/NullableEnumModelBinderProvider.cs+++ b/Jellyfin.Api/ModelBinders/NullableEnumModelBinderProvider.cs@@ -24,4 +24,4 @@ namespace Jellyfin.Api.ModelBindersreturn new NullableEnumModelBinder(logger);}}-}\ No newline at end of file+}diff --git a/Jellyfin.Api/Models/LibraryStructureDto/MediaPathDto.cs b/Jellyfin.Api/Models/LibraryStructureDto/MediaPathDto.csindex f659882595..8b26ec317a 100644--- a/Jellyfin.Api/Models/LibraryStructureDto/MediaPathDto.cs+++ b/Jellyfin.Api/Models/LibraryStructureDto/MediaPathDto.cs@@ -24,4 +24,4 @@ namespace Jellyfin.Api.Models.LibraryStructureDto/// </summary>public MediaPathInfo? PathInfo { get; set; }}-}\ No newline at end of file+}diff --git a/Jellyfin.Api/Models/LiveTvDtos/SetChannelMappingDto.cs b/Jellyfin.Api/Models/LiveTvDtos/SetChannelMappingDto.csindex 2ddaa89e8b..e7501bd9fb 100644--- a/Jellyfin.Api/Models/LiveTvDtos/SetChannelMappingDto.cs+++ b/Jellyfin.Api/Models/LiveTvDtos/SetChannelMappingDto.cs@@ -25,4 +25,4 @@ namespace Jellyfin.Api.Models.LiveTvDtos[Required]public string ProviderChannelId { get; set; } = string.Empty;}-}\ No newline at end of file+}diff --git a/Jellyfin.Api/Models/MediaInfoDtos/PlaybackInfoDto.cs b/Jellyfin.Api/Models/MediaInfoDtos/PlaybackInfoDto.csindex 2cfdba507e..c6bd5e56ec 100644--- a/Jellyfin.Api/Models/MediaInfoDtos/PlaybackInfoDto.cs+++ b/Jellyfin.Api/Models/MediaInfoDtos/PlaybackInfoDto.cs@@ -83,4 +83,4 @@ namespace Jellyfin.Api.Models.MediaInfoDtos/// </summary>public bool? AutoOpenLiveStream { get; set; }}-}\ No newline at end of file+}diff --git a/Jellyfin.Api/Models/SubtitleDtos/UploadSubtitleDto.cs b/Jellyfin.Api/Models/SubtitleDtos/UploadSubtitleDto.csindex 30473255e8..be05957987 100644--- a/Jellyfin.Api/Models/SubtitleDtos/UploadSubtitleDto.cs+++ b/Jellyfin.Api/Models/SubtitleDtos/UploadSubtitleDto.cs@@ -31,4 +31,4 @@ namespace Jellyfin.Api.Models.SubtitleDtos[Required]public string Data { get; set; } = string.Empty;}-}\ No newline at end of file+}diff --git a/Jellyfin.Data/Enums/BaseItemKind.cs b/Jellyfin.Data/Enums/BaseItemKind.csindex 8757817463..6fac6c4878 100644--- a/Jellyfin.Data/Enums/BaseItemKind.cs+++ b/Jellyfin.Data/Enums/BaseItemKind.cs@@ -134,7 +134,7 @@PlaylistsFolder,/// <summary>- /// Item is program+ /// Item is program./// </summary>Program,diff --git a/Jellyfin.Data/Enums/UnratedItem.cs b/Jellyfin.Data/Enums/UnratedItem.csindex 871794086d..21ec65af52 100644--- a/Jellyfin.Data/Enums/UnratedItem.cs+++ b/Jellyfin.Data/Enums/UnratedItem.cs@@ -31,7 +31,7 @@ namespace Jellyfin.Data.EnumsBook = 4,/// <summary>- /// A live TV channel+ /// A live TV channel./// </summary>LiveTvChannel = 5,diff --git a/Jellyfin.Data/Jellyfin.Data.csproj b/Jellyfin.Data/Jellyfin.Data.csprojindex 87233d907a..f2779d8f20 100644--- a/Jellyfin.Data/Jellyfin.Data.csproj+++ b/Jellyfin.Data/Jellyfin.Data.csproj@@ -30,7 +30,7 @@<!-- Code analysers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csprojindex 5fa386ecac..4cc2159031 100644--- a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj+++ b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj@@ -31,7 +31,7 @@<!-- Code analysers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/Jellyfin.Networking/Jellyfin.Networking.csproj b/Jellyfin.Networking/Jellyfin.Networking.csprojindex 0cd9a59156..a6af8566c0 100644--- a/Jellyfin.Networking/Jellyfin.Networking.csproj+++ b/Jellyfin.Networking/Jellyfin.Networking.csproj@@ -12,7 +12,7 @@<!-- Code Analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs b/Jellyfin.Server.Implementations/Devices/DeviceManager.csindex a55949df83..54d1a53376 100644--- a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs+++ b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs@@ -24,7 +24,7 @@ namespace Jellyfin.Server.Implementations.Devices{private readonly JellyfinDbProvider _dbProvider;private readonly IUserManager _userManager;- private readonly ConcurrentDictionary<string, ClientCapabilities> _capabilitiesMap = new ();+ private readonly ConcurrentDictionary<string, ClientCapabilities> _capabilitiesMap = new();/// <summary>/// Initializes a new instance of the <see cref="DeviceManager"/> class.diff --git a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csprojindex d22757c033..86aec13999 100644--- a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj+++ b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj@@ -6,10 +6,14 @@<GenerateDocumentationFile>true</GenerateDocumentationFile></PropertyGroup>+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>+ </PropertyGroup>+<!-- Code analysers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/Jellyfin.Server.Implementations/ModelBuilderExtensions.cs b/Jellyfin.Server.Implementations/ModelBuilderExtensions.csindex 80ad65a42c..e73a90cffd 100644--- a/Jellyfin.Server.Implementations/ModelBuilderExtensions.cs+++ b/Jellyfin.Server.Implementations/ModelBuilderExtensions.cs@@ -45,4 +45,4 @@ namespace Jellyfin.Server.ImplementationsmodelBuilder.UseValueConverterForType<DateTime?>(new DateTimeKindValueConverter(kind));}}-}\ No newline at end of file+}diff --git a/Jellyfin.Server/Filters/SecurityRequirementsOperationFilter.cs b/Jellyfin.Server/Filters/SecurityRequirementsOperationFilter.csindex 802662ce2f..077908895f 100644--- a/Jellyfin.Server/Filters/SecurityRequirementsOperationFilter.cs+++ b/Jellyfin.Server/Filters/SecurityRequirementsOperationFilter.cs@@ -75,4 +75,4 @@ namespace Jellyfin.Server.Filters}}}-}\ No newline at end of file+}diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csprojindex 1638310fde..eb82a9d2bb 100644--- a/Jellyfin.Server/Jellyfin.Server.csproj+++ b/Jellyfin.Server/Jellyfin.Server.csproj@@ -14,6 +14,10 @@<GenerateDocumentationFile>true</GenerateDocumentationFile></PropertyGroup>+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>+ </PropertyGroup>+<ItemGroup><Compile Include="..\SharedVersion.cs" /></ItemGroup>@@ -25,7 +29,7 @@<!-- Code Analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/Jellyfin.Server/Middleware/LegacyEmbyRouteRewriteMiddleware.cs b/Jellyfin.Server/Middleware/LegacyEmbyRouteRewriteMiddleware.csindex fdd8974d2b..b214299df3 100644--- a/Jellyfin.Server/Middleware/LegacyEmbyRouteRewriteMiddleware.cs+++ b/Jellyfin.Server/Middleware/LegacyEmbyRouteRewriteMiddleware.cs@@ -51,4 +51,4 @@ namespace Jellyfin.Server.Middlewareawait _next(httpContext).ConfigureAwait(false);}}-}\ No newline at end of file+}diff --git a/Jellyfin.Server/Middleware/RobotsRedirectionMiddleware.cs b/Jellyfin.Server/Middleware/RobotsRedirectionMiddleware.csindex 9d40d74fe9..fabcd2da7e 100644--- a/Jellyfin.Server/Middleware/RobotsRedirectionMiddleware.cs+++ b/Jellyfin.Server/Middleware/RobotsRedirectionMiddleware.cs@@ -44,4 +44,4 @@ namespace Jellyfin.Server.Middlewareawait _next(httpContext).ConfigureAwait(false);}}-}\ No newline at end of file+}diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csprojindex 4ed44baefc..2a2fffce08 100644--- a/MediaBrowser.Common/MediaBrowser.Common.csproj+++ b/MediaBrowser.Common/MediaBrowser.Common.csproj@@ -38,6 +38,10 @@<SymbolPackageFormat>snupkg</SymbolPackageFormat></PropertyGroup>+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>+ </PropertyGroup>+<PropertyGroup Condition=" '$(Stability)'=='Unstable'"><!-- Include all symbols in the main nupkg until Azure Artifact Feed starts supporting ingesting NuGet symbol packages. --><AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>@@ -46,7 +50,7 @@<!-- Code analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/MediaBrowser.Controller/Channels/ChannelLatestMediaSearch.cs b/MediaBrowser.Controller/Channels/ChannelLatestMediaSearch.csindex 6f0761e64b..e02f42fa48 100644--- a/MediaBrowser.Controller/Channels/ChannelLatestMediaSearch.cs+++ b/MediaBrowser.Controller/Channels/ChannelLatestMediaSearch.cs@@ -8,4 +8,4 @@ namespace MediaBrowser.Controller.Channels{public string UserId { get; set; }}-}\ No newline at end of file+}diff --git a/MediaBrowser.Controller/Channels/IHasFolderAttributes.cs b/MediaBrowser.Controller/Channels/IHasFolderAttributes.csindex 64af8496c7..6c92785d21 100644--- a/MediaBrowser.Controller/Channels/IHasFolderAttributes.cs+++ b/MediaBrowser.Controller/Channels/IHasFolderAttributes.cs@@ -6,4 +6,4 @@ namespace MediaBrowser.Controller.Channels{string[] Attributes { get; }}-}\ No newline at end of file+}diff --git a/MediaBrowser.Controller/Channels/ISupportsDelete.cs b/MediaBrowser.Controller/Channels/ISupportsDelete.csindex 204054374e..30798a4b28 100644--- a/MediaBrowser.Controller/Channels/ISupportsDelete.cs+++ b/MediaBrowser.Controller/Channels/ISupportsDelete.cs@@ -12,4 +12,4 @@ namespace MediaBrowser.Controller.ChannelsTask DeleteItem(string id, CancellationToken cancellationToken);}-}\ No newline at end of file+}diff --git a/MediaBrowser.Controller/Channels/ISupportsLatestMedia.cs b/MediaBrowser.Controller/Channels/ISupportsLatestMedia.csindex dbba7cba2d..8ad93387ee 100644--- a/MediaBrowser.Controller/Channels/ISupportsLatestMedia.cs+++ b/MediaBrowser.Controller/Channels/ISupportsLatestMedia.cs@@ -18,4 +18,4 @@ namespace MediaBrowser.Controller.Channels/// <returns>The latest media.</returns>Task<IEnumerable<ChannelItemInfo>> GetLatestMedia(ChannelLatestMediaSearch request, CancellationToken cancellationToken);}-}\ No newline at end of file+}diff --git a/MediaBrowser.Controller/Collections/CollectionCreatedEventArgs.cs b/MediaBrowser.Controller/Collections/CollectionCreatedEventArgs.csindex 82b3a49773..1797d15eac 100644--- a/MediaBrowser.Controller/Collections/CollectionCreatedEventArgs.cs+++ b/MediaBrowser.Controller/Collections/CollectionCreatedEventArgs.cs@@ -21,4 +21,4 @@ namespace MediaBrowser.Controller.Collections/// <value>The options.</value>public CollectionCreationOptions Options { get; set; }}-}\ No newline at end of file+}diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.csindex 95d49508fe..f5dd825489 100644--- a/MediaBrowser.Controller/Entities/BaseItem.cs+++ b/MediaBrowser.Controller/Entities/BaseItem.cs@@ -2592,9 +2592,9 @@ namespace MediaBrowser.Controller.Entities.Select(i => i.OfficialRating).Where(i => !string.IsNullOrEmpty(i)).Distinct(StringComparer.OrdinalIgnoreCase)- .Select(i => (i, LocalizationManager.GetRatingLevel(i)))+ .Select(rating => (rating, LocalizationManager.GetRatingLevel(rating))).OrderBy(i => i.Item2 ?? 1000)- .Select(i => i.Item1);+ .Select(i => i.rating);OfficialRating = ratings.FirstOrDefault() ?? currentOfficialRating;diff --git a/MediaBrowser.Controller/Entities/BaseItemExtensions.cs b/MediaBrowser.Controller/Entities/BaseItemExtensions.csindex 33870e2fbf..e0583e6308 100644--- a/MediaBrowser.Controller/Entities/BaseItemExtensions.cs+++ b/MediaBrowser.Controller/Entities/BaseItemExtensions.cs@@ -47,11 +47,12 @@ namespace MediaBrowser.Controller.Entitiesif (file.StartsWith("http", StringComparison.OrdinalIgnoreCase)){item.SetImage(- new ItemImageInfo- {- Path = file,- Type = imageType- }, 0);+ new ItemImageInfo+ {+ Path = file,+ Type = imageType+ },+ 0);}else{diff --git a/MediaBrowser.Controller/Entities/IHasShares.cs b/MediaBrowser.Controller/Entities/IHasShares.csindex dca5af873f..e6fa27703b 100644--- a/MediaBrowser.Controller/Entities/IHasShares.cs+++ b/MediaBrowser.Controller/Entities/IHasShares.cs@@ -8,4 +8,4 @@ namespace MediaBrowser.Controller.Entities{Share[] Shares { get; set; }}-}\ No newline at end of file+}diff --git a/MediaBrowser.Controller/Entities/LinkedChildComparer.cs b/MediaBrowser.Controller/Entities/LinkedChildComparer.csindex 4e58e29429..de8b168081 100644--- a/MediaBrowser.Controller/Entities/LinkedChildComparer.cs+++ b/MediaBrowser.Controller/Entities/LinkedChildComparer.cs@@ -32,4 +32,4 @@ namespace MediaBrowser.Controller.Entitiesreturn ((obj.Path ?? string.Empty) + (obj.LibraryItemId ?? string.Empty) + obj.Type).GetHashCode(StringComparison.Ordinal);}}-}\ No newline at end of file+}diff --git a/MediaBrowser.Controller/Entities/LinkedChildType.cs b/MediaBrowser.Controller/Entities/LinkedChildType.csindex 9ddb7b6202..d39e36ff28 100644--- a/MediaBrowser.Controller/Entities/LinkedChildType.cs+++ b/MediaBrowser.Controller/Entities/LinkedChildType.cs@@ -15,4 +15,4 @@/// </summary>Shortcut = 1}-}\ No newline at end of file+}diff --git a/MediaBrowser.Controller/LiveTv/ActiveRecordingInfo.cs b/MediaBrowser.Controller/LiveTv/ActiveRecordingInfo.csindex 463061e686..1a81a8a31e 100644--- a/MediaBrowser.Controller/LiveTv/ActiveRecordingInfo.cs+++ b/MediaBrowser.Controller/LiveTv/ActiveRecordingInfo.cs@@ -16,4 +16,4 @@ namespace MediaBrowser.Controller.LiveTvpublic CancellationTokenSource CancellationTokenSource { get; set; }}-}\ No newline at end of file+}diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csprojindex cf3b7bc7a0..432159d5d0 100644--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj@@ -13,6 +13,10 @@<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression></PropertyGroup>+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>+ </PropertyGroup>+<ItemGroup><PackageReference Include="Diacritics" Version="3.3.10" /><PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />@@ -49,7 +53,7 @@<!-- Code Analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/MediaBrowser.Controller/MediaEncoding/BaseEncodingJobOptions.cs b/MediaBrowser.Controller/MediaEncoding/BaseEncodingJobOptions.csindex dd6f468dab..462585ce35 100644--- a/MediaBrowser.Controller/MediaEncoding/BaseEncodingJobOptions.cs+++ b/MediaBrowser.Controller/MediaEncoding/BaseEncodingJobOptions.cs@@ -201,4 +201,4 @@ namespace MediaBrowser.Controller.MediaEncodingreturn null;}}-}\ No newline at end of file+}diff --git a/MediaBrowser.Controller/MediaEncoding/TranscodingJobType.cs b/MediaBrowser.Controller/MediaEncoding/TranscodingJobType.csindex 66b6283719..c1bb387e1a 100644--- a/MediaBrowser.Controller/MediaEncoding/TranscodingJobType.cs+++ b/MediaBrowser.Controller/MediaEncoding/TranscodingJobType.cs@@ -20,4 +20,4 @@/// </summary>Dash}-}\ No newline at end of file+}diff --git a/MediaBrowser.Controller/Net/WebSocketListenerState.cs b/MediaBrowser.Controller/Net/WebSocketListenerState.csindex 70604d60a0..2410801d60 100644--- a/MediaBrowser.Controller/Net/WebSocketListenerState.cs+++ b/MediaBrowser.Controller/Net/WebSocketListenerState.cs@@ -14,4 +14,4 @@ namespace MediaBrowser.Controller.Netpublic long IntervalMs { get; set; }}-}\ No newline at end of file+}diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.csindex e6d975ffec..d4de97651f 100644--- a/MediaBrowser.Controller/Providers/DirectoryService.cs+++ b/MediaBrowser.Controller/Providers/DirectoryService.cs@@ -12,11 +12,11 @@ namespace MediaBrowser.Controller.Providers{private readonly IFileSystem _fileSystem;- private readonly ConcurrentDictionary<string, FileSystemMetadata[]> _cache = new (StringComparer.Ordinal);+ private readonly ConcurrentDictionary<string, FileSystemMetadata[]> _cache = new(StringComparer.Ordinal);- private readonly ConcurrentDictionary<string, FileSystemMetadata> _fileCache = new (StringComparer.Ordinal);+ private readonly ConcurrentDictionary<string, FileSystemMetadata> _fileCache = new(StringComparer.Ordinal);- private readonly ConcurrentDictionary<string, List<string>> _filePathCache = new (StringComparer.Ordinal);+ private readonly ConcurrentDictionary<string, List<string>> _filePathCache = new(StringComparer.Ordinal);public DirectoryService(IFileSystem fileSystem){diff --git a/MediaBrowser.Controller/Providers/RefreshPriority.cs b/MediaBrowser.Controller/Providers/RefreshPriority.csindex 3619f679d6..e4c39cea16 100644--- a/MediaBrowser.Controller/Providers/RefreshPriority.cs+++ b/MediaBrowser.Controller/Providers/RefreshPriority.cs@@ -20,4 +20,4 @@/// </summary>Low = 2}-}\ No newline at end of file+}diff --git a/MediaBrowser.LocalMetadata/MediaBrowser.LocalMetadata.csproj b/MediaBrowser.LocalMetadata/MediaBrowser.LocalMetadata.csprojindex a3db717b9f..41c79651dc 100644--- a/MediaBrowser.LocalMetadata/MediaBrowser.LocalMetadata.csproj+++ b/MediaBrowser.LocalMetadata/MediaBrowser.LocalMetadata.csproj@@ -23,7 +23,7 @@<!-- Code Analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csprojindex 9f6d8e7fe9..b60ccd2ca5 100644--- a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj+++ b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj@@ -11,6 +11,10 @@<GenerateDocumentationFile>true</GenerateDocumentationFile></PropertyGroup>+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>+ </PropertyGroup>+<ItemGroup><Compile Include="..\SharedVersion.cs" /></ItemGroup>@@ -32,7 +36,7 @@<!-- Code Analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.csindex 9057a101ab..4e4957ef71 100644--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs@@ -28,7 +28,7 @@ namespace MediaBrowser.MediaEncoding.Probingprivate readonly char[] _nameDelimiters = { '/', '|', ';', '\\' };- private static readonly Regex _performerPattern = new (@"(?<name>.*) \((?<instrument>.*)\)");+ private static readonly Regex _performerPattern = new(@"(?<name>.*) \((?<instrument>.*)\)");private readonly ILogger _logger;private readonly ILocalizationManager _localization;diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.csindex c6ce457880..a190172158 100644--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs@@ -679,8 +679,8 @@ namespace MediaBrowser.Model.Dlna// TODO: This doesn't account for situations where the device is able to handle the media's bitrate, but the connection isn't fast enoughvar directPlayEligibilityResult = IsEligibleForDirectPlay(item, GetBitrateForDirectPlayCheck(item, options, true) ?? 0, subtitleStream, audioStream, options, PlayMethod.DirectPlay);var directStreamEligibilityResult = IsEligibleForDirectPlay(item, options.GetMaxBitrate(false) ?? 0, subtitleStream, audioStream, options, PlayMethod.DirectStream);- bool isEligibleForDirectPlay = options.EnableDirectPlay && (options.ForceDirectPlay || directPlayEligibilityResult.Item1);- bool isEligibleForDirectStream = options.EnableDirectStream && (options.ForceDirectStream || directStreamEligibilityResult.Item1);+ bool isEligibleForDirectPlay = options.EnableDirectPlay && (options.ForceDirectPlay || directPlayEligibilityResult.directPlay);+ bool isEligibleForDirectStream = options.EnableDirectStream && (options.ForceDirectStream || directStreamEligibilityResult.directPlay);_logger.LogDebug("Profile: {0}, Path: {1}, isEligibleForDirectPlay: {2}, isEligibleForDirectStream: {3}",@@ -695,7 +695,7 @@ namespace MediaBrowser.Model.Dlna{// See if it can be direct playedvar directPlayInfo = GetVideoDirectPlayProfile(options, item, videoStream, audioStream, isEligibleForDirectStream);- var directPlay = directPlayInfo.Item1;+ var directPlay = directPlayInfo.playMethod;if (directPlay != null){@@ -713,17 +713,17 @@ namespace MediaBrowser.Model.Dlnareturn playlistItem;}- transcodeReasons.AddRange(directPlayInfo.Item2);+ transcodeReasons.AddRange(directPlayInfo.transcodeReasons);}- if (directPlayEligibilityResult.Item2.HasValue)+ if (directPlayEligibilityResult.reason.HasValue){- transcodeReasons.Add(directPlayEligibilityResult.Item2.Value);+ transcodeReasons.Add(directPlayEligibilityResult.reason.Value);}- if (directStreamEligibilityResult.Item2.HasValue)+ if (directStreamEligibilityResult.reason.HasValue){- transcodeReasons.Add(directStreamEligibilityResult.Item2.Value);+ transcodeReasons.Add(directStreamEligibilityResult.reason.Value);}// Can't direct play, find the transcoding profile@@ -1000,7 +1000,7 @@ namespace MediaBrowser.Model.Dlnareturn 7168000;}- private (PlayMethod?, List<TranscodeReason>) GetVideoDirectPlayProfile(+ private (PlayMethod? playMethod, List<TranscodeReason> transcodeReasons) GetVideoDirectPlayProfile(VideoOptions options,MediaSourceInfo mediaSource,MediaStream videoStream,diff --git a/MediaBrowser.Model/Entities/MetadataFields.cs b/MediaBrowser.Model/Entities/MetadataField.cssimilarity index 100%rename from MediaBrowser.Model/Entities/MetadataFields.csrename to MediaBrowser.Model/Entities/MetadataField.csdiff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csprojindex a161b99fd2..63f7ada5cb 100644--- a/MediaBrowser.Model/MediaBrowser.Model.csproj+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj@@ -23,6 +23,10 @@<SymbolPackageFormat>snupkg</SymbolPackageFormat></PropertyGroup>+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>+ </PropertyGroup>+<PropertyGroup Condition=" '$(Stability)'=='Unstable'"><!-- Include all symbols in the main nupkg until Azure Artifact Feed starts supporting ingesting NuGet symbol packages. --><AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>@@ -46,7 +50,7 @@<!-- Code Analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup><ItemGroup>diff --git a/MediaBrowser.Model/Plugins/PluginStatus.cs b/MediaBrowser.Model/Plugins/PluginStatus.csindex 4b9b9bbeee..bd420d7b4e 100644--- a/MediaBrowser.Model/Plugins/PluginStatus.cs+++ b/MediaBrowser.Model/Plugins/PluginStatus.cs@@ -29,7 +29,7 @@ namespace MediaBrowser.Model.PluginsNotSupported = -2,/// <summary>- /// This plugin caused an error when instantiated. (Either DI loop, or exception)+ /// This plugin caused an error when instantiated (either DI loop, or exception)./// </summary>Malfunctioned = -3,diff --git a/MediaBrowser.Model/Session/HardwareEncodingType.cs b/MediaBrowser.Model/Session/HardwareEncodingType.csindex 0e172f35f3..0db5697d34 100644--- a/MediaBrowser.Model/Session/HardwareEncodingType.cs+++ b/MediaBrowser.Model/Session/HardwareEncodingType.cs@@ -6,42 +6,42 @@public enum HardwareEncodingType{/// <summary>- /// AMD AMF+ /// AMD AMF./// </summary>AMF = 0,/// <summary>- /// Intel Quick Sync Video+ /// Intel Quick Sync Video./// </summary>QSV = 1,/// <summary>- /// NVIDIA NVENC+ /// NVIDIA NVENC./// </summary>NVENC = 2,/// <summary>- /// OpenMax OMX+ /// OpenMax OMX./// </summary>OMX = 3,/// <summary>- /// Exynos V4L2 MFC+ /// Exynos V4L2 MFC./// </summary>V4L2M2M = 4,/// <summary>- /// MediaCodec Android+ /// MediaCodec Android./// </summary>MediaCodec = 5,/// <summary>- /// Video Acceleration API (VAAPI)+ /// Video Acceleration API (VAAPI)./// </summary>VAAPI = 6,/// <summary>- /// Video ToolBox+ /// Video ToolBox./// </summary>VideoToolBox = 7}diff --git a/MediaBrowser.Providers/MediaBrowser.Providers.csproj b/MediaBrowser.Providers/MediaBrowser.Providers.csprojindex dac5aaf564..43cf621cd7 100644--- a/MediaBrowser.Providers/MediaBrowser.Providers.csproj+++ b/MediaBrowser.Providers/MediaBrowser.Providers.csproj@@ -32,10 +32,14 @@<CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet></PropertyGroup>+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>+ </PropertyGroup>+<!-- Code Analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs b/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.csindex 6fa34b9859..3a3048cec4 100644--- a/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs+++ b/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs@@ -27,7 +27,7 @@ namespace MediaBrowser.Providers.Studiosprivate readonly IServerConfigurationManager _config;private readonly IHttpClientFactory _httpClientFactory;private readonly IFileSystem _fileSystem;- private readonly String repositoryUrl;+ private readonly string repositoryUrl;public StudiosImageProvider(IServerConfigurationManager config, IHttpClientFactory httpClientFactory, IFileSystem fileSystem){diff --git a/MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs b/MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.csindex a3a78103ea..234d717bfb 100644--- a/MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs+++ b/MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs@@ -11,7 +11,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb/// </summary>public static class TmdbUtils{- private static readonly Regex _nonWords = new (@"[\W_]+", RegexOptions.Compiled);+ private static readonly Regex _nonWords = new(@"[\W_]+", RegexOptions.Compiled);/// <summary>/// URL of the TMDB instance to use.diff --git a/MediaBrowser.XbmcMetadata/MediaBrowser.XbmcMetadata.csproj b/MediaBrowser.XbmcMetadata/MediaBrowser.XbmcMetadata.csprojindex 926be5a927..ad06688fb7 100644--- a/MediaBrowser.XbmcMetadata/MediaBrowser.XbmcMetadata.csproj+++ b/MediaBrowser.XbmcMetadata/MediaBrowser.XbmcMetadata.csproj@@ -23,7 +23,7 @@<!-- Code Analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/jellyfin.ruleset b/jellyfin.rulesetindex 7adc35087f..e9293588c7 100644--- a/jellyfin.ruleset+++ b/jellyfin.ruleset@@ -1,6 +1,21 @@<?xml version="1.0" encoding="utf-8"?><RuleSet Name="Rules for Jellyfin.Server" Description="Code analysis rules for Jellyfin.Server.csproj" ToolsVersion="14.0"><Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">+ <!-- error on SA1000: The keyword 'new' should be followed by a space -->+ <Rule Id="SA1000" Action="Error" />+ <!-- error on SA1001: Commas should not be preceded by whitespace -->+ <Rule Id="SA1001" Action="Error" />+ <!-- error on SA1117: The parameters should all be placed on the same line or each parameter should be placed on its own line -->+ <Rule Id="SA1117" Action="Error" />+ <!-- error on SA1142: Refer to tuple fields by name -->+ <Rule Id="SA1142" Action="Error" />+ <!-- error on SA1210: Using directives should be ordered alphabetically by the namespaces -->+ <Rule Id="SA1210" Action="Error" />+ <!-- error on SA1518: File is required to end with a single newline character -->+ <Rule Id="SA1518" Action="Error" />+ <!-- error on SA1629: Documentation text should end with a period -->+ <Rule Id="SA1629" Action="Error" />+<!-- disable warning SA1009: Closing parenthesis should be followed by a space. --><Rule Id="SA1009" Action="None" /><!-- disable warning SA1011: Closing square bracket should be followed by a space. -->diff --git a/src/Jellyfin.Extensions/Jellyfin.Extensions.csproj b/src/Jellyfin.Extensions/Jellyfin.Extensions.csprojindex 3d9538d1bb..90d2a0da6b 100644--- a/src/Jellyfin.Extensions/Jellyfin.Extensions.csproj+++ b/src/Jellyfin.Extensions/Jellyfin.Extensions.csproj@@ -30,7 +30,7 @@<!-- Code Analyzers--><ItemGroup><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/src/Jellyfin.Extensions/Json/JsonDefaults.cs b/src/Jellyfin.Extensions/Json/JsonDefaults.csindex f4ec911231..2cd89dc3bc 100644--- a/src/Jellyfin.Extensions/Json/JsonDefaults.cs+++ b/src/Jellyfin.Extensions/Json/JsonDefaults.cs@@ -25,7 +25,7 @@ namespace Jellyfin.Extensions.Json/// -> AddJellyfinApi/// -> AddJsonOptions./// </summary>- private static readonly JsonSerializerOptions _jsonSerializerOptions = new ()+ private static readonly JsonSerializerOptions _jsonSerializerOptions = new(){ReadCommentHandling = JsonCommentHandling.Disallow,WriteIndented = false,@@ -44,12 +44,12 @@ namespace Jellyfin.Extensions.Json}};- private static readonly JsonSerializerOptions _pascalCaseJsonSerializerOptions = new (_jsonSerializerOptions)+ private static readonly JsonSerializerOptions _pascalCaseJsonSerializerOptions = new(_jsonSerializerOptions){PropertyNamingPolicy = null};- private static readonly JsonSerializerOptions _camelCaseJsonSerializerOptions = new (_jsonSerializerOptions)+ private static readonly JsonSerializerOptions _camelCaseJsonSerializerOptions = new(_jsonSerializerOptions){PropertyNamingPolicy = JsonNamingPolicy.CamelCase};diff --git a/src/Jellyfin.Extensions/SplitStringExtensions.cs b/src/Jellyfin.Extensions/SplitStringExtensions.csindex 5fa5c01235..1d1c377f56 100644--- a/src/Jellyfin.Extensions/SplitStringExtensions.cs+++ b/src/Jellyfin.Extensions/SplitStringExtensions.cs@@ -43,7 +43,7 @@ namespace Jellyfin.Extensions/// <param name="separator">The separator to split on.</param>/// <returns>The enumerator struct.</returns>[Pure]- public static Enumerator SpanSplit(this string str, char separator) => new (str.AsSpan(), separator);+ public static Enumerator SpanSplit(this string str, char separator) => new(str.AsSpan(), separator);/// <summary>/// Creates a new span split enumerator.@@ -52,7 +52,7 @@ namespace Jellyfin.Extensions/// <param name="separator">The separator to split on.</param>/// <returns>The enumerator struct.</returns>[Pure]- public static Enumerator Split(this ReadOnlySpan<char> str, char separator) => new (str, separator);+ public static Enumerator Split(this ReadOnlySpan<char> str, char separator) => new(str, separator);/// <summary>/// Provides an enumerator for the substrings seperated by the separator.diff --git a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csprojindex bcbe9c1be0..6e0474dbfe 100644--- a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj+++ b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj@@ -27,7 +27,7 @@<!-- Code Analyzers --><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj b/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csprojindex ce607b2ec9..8476c935ea 100644--- a/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj+++ b/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj@@ -22,7 +22,7 @@<!-- Code Analyzers --><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/tests/Jellyfin.Controller.Tests/DirectoryServiceTests.cs b/tests/Jellyfin.Controller.Tests/DirectoryServiceTests.csindex feffb50e82..46439aecbe 100644--- a/tests/Jellyfin.Controller.Tests/DirectoryServiceTests.cs+++ b/tests/Jellyfin.Controller.Tests/DirectoryServiceTests.cs@@ -13,22 +13,22 @@ namespace Jellyfin.Controller.Testsprivate static readonly FileSystemMetadata[] _lowerCaseFileSystemMetadata ={- new ()+ new(){FullName = LowerCasePath + "/Artwork",IsDirectory = true},- new ()+ new(){FullName = LowerCasePath + "/Some Other Folder",IsDirectory = true},- new ()+ new(){FullName = LowerCasePath + "/Song 2.mp3",IsDirectory = false},- new ()+ new(){FullName = LowerCasePath + "/Song 3.mp3",IsDirectory = false@@ -37,12 +37,12 @@ namespace Jellyfin.Controller.Testsprivate static readonly FileSystemMetadata[] _upperCaseFileSystemMetadata ={- new ()+ new(){FullName = UpperCasePath + "/Lyrics",IsDirectory = true},- new ()+ new(){FullName = UpperCasePath + "/Song 1.mp3",IsDirectory = falsediff --git a/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj b/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csprojindex 0ffc19833a..981c7e9c97 100644--- a/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj+++ b/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj@@ -22,7 +22,7 @@<!-- Code Analyzers --><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/tests/Jellyfin.Dlna.Tests/DlnaManagerTests.cs b/tests/Jellyfin.Dlna.Tests/DlnaManagerTests.csindex 668bd8f878..78a956f5f8 100644--- a/tests/Jellyfin.Dlna.Tests/DlnaManagerTests.cs+++ b/tests/Jellyfin.Dlna.Tests/DlnaManagerTests.cs@@ -46,7 +46,7 @@ namespace Jellyfin.Dlna.TestsModelDescription = "LG WebOSTV DMRplus",ModelName = "LG TV",ModelNumber = "1.0",- Identification = new ()+ Identification = new(){FriendlyName = "My Device",Manufacturer = "LG Electronics",@@ -92,7 +92,7 @@ namespace Jellyfin.Dlna.TestsModelDescription = "LG WebOSTV DMRplus",ModelName = "LG TV",ModelNumber = "1.0",- Identification = new ()+ Identification = new(){FriendlyName = "My Device",Manufacturer = "LG Electronics",@@ -120,7 +120,7 @@ namespace Jellyfin.Dlna.Tests{Name = "Test Profile",FriendlyName = "My .*",- Identification = new ()+ Identification = new()};var deviceMatch = GetManager().IsMatch(device.ToDeviceIdentification(), profile.Identification);diff --git a/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj b/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csprojindex 0981660012..6200a148b4 100644--- a/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj+++ b/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj@@ -17,7 +17,7 @@<!-- Code Analyzers --><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj b/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csprojindex ee3af7559e..3dcc00ff0a 100644--- a/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj+++ b/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj@@ -23,7 +23,7 @@<!-- Code Analyzers --><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/tests/Jellyfin.Extensions.Tests/Json/Converters/JsonStringConverterTests.cs b/tests/Jellyfin.Extensions.Tests/Json/Converters/JsonStringConverterTests.csindex 655e070742..345f37cbe0 100644--- a/tests/Jellyfin.Extensions.Tests/Json/Converters/JsonStringConverterTests.cs+++ b/tests/Jellyfin.Extensions.Tests/Json/Converters/JsonStringConverterTests.cs@@ -6,7 +6,7 @@ namespace Jellyfin.Extensions.Tests.Json.Converters{public class JsonStringConverterTests{- private readonly JsonSerializerOptions _jsonSerializerOptions = new ()+ private readonly JsonSerializerOptions _jsonSerializerOptions = new(){Converters ={diff --git a/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj b/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csprojindex dc4a42c19f..f366f553a5 100644--- a/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj+++ b/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj@@ -31,7 +31,7 @@<!-- Code Analyzers --><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj b/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csprojindex 7e8397d9f7..d4a1a30c34 100644--- a/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj+++ b/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj@@ -17,7 +17,7 @@<!-- Code Analyzers --><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csprojindex 4096873a37..4c95e78b17 100644--- a/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj+++ b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj@@ -25,7 +25,7 @@<!-- Code Analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj b/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csprojindex 78556ee675..87acc7f68a 100644--- a/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj+++ b/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj@@ -23,7 +23,7 @@<!-- Code Analyzers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj b/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csprojindex 10767ae238..4338c812d8 100644--- a/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj+++ b/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj@@ -29,7 +29,7 @@<!-- Code Analyzers --><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/tests/Jellyfin.Providers.Tests/MediaInfo/EmbeddedImageProviderTests.cs b/tests/Jellyfin.Providers.Tests/MediaInfo/EmbeddedImageProviderTests.csindex 5583218101..98ac1dd640 100644--- a/tests/Jellyfin.Providers.Tests/MediaInfo/EmbeddedImageProviderTests.cs+++ b/tests/Jellyfin.Providers.Tests/MediaInfo/EmbeddedImageProviderTests.cs@@ -62,7 +62,7 @@ namespace Jellyfin.Providers.Tests.MediaInfofor (int i = 1; i <= targetIndex; i++){var name = i == targetIndex ? filename : "unmatched";- attachments.Add(new ()+ attachments.Add(new(){FileName = name,MimeType = mimetype,@@ -107,7 +107,7 @@ namespace Jellyfin.Providers.Tests.MediaInfofor (int i = 1; i <= targetIndex; i++){var comment = i == targetIndex ? label : "unmatched";- streams.Add(new ()+ streams.Add(new(){Type = MediaStreamType.EmbeddedImage,Index = i,diff --git a/tests/Jellyfin.Providers.Tests/MediaInfo/SubtitleResolverTests.cs b/tests/Jellyfin.Providers.Tests/MediaInfo/SubtitleResolverTests.csindex 33da277e35..040ea5d1dc 100644--- a/tests/Jellyfin.Providers.Tests/MediaInfo/SubtitleResolverTests.cs+++ b/tests/Jellyfin.Providers.Tests/MediaInfo/SubtitleResolverTests.cs@@ -113,7 +113,7 @@ namespace Jellyfin.Providers.Tests.MediaInfoprivate static MediaStream CreateMediaStream(string path, string codec, string? language, int index, bool isForced = false, bool isDefault = false){- return new ()+ return new(){Index = index,Codec = codec,diff --git a/tests/Jellyfin.Providers.Tests/MediaInfo/VideoImageProviderTests.cs b/tests/Jellyfin.Providers.Tests/MediaInfo/VideoImageProviderTests.csindex 839925dd10..1503a33922 100644--- a/tests/Jellyfin.Providers.Tests/MediaInfo/VideoImageProviderTests.cs+++ b/tests/Jellyfin.Providers.Tests/MediaInfo/VideoImageProviderTests.cs@@ -21,7 +21,7 @@ namespace Jellyfin.Providers.Tests.MediaInfo{private static TheoryData<Video> GetImage_UnsupportedInput_ReturnsNoImage_TestData(){- return new ()+ return new(){new Movie { IsPlaceHolder = true },@@ -82,7 +82,7 @@ namespace Jellyfin.Providers.Tests.MediaInfo[InlineData(500, 50)] // calculated timepublic async void GetImage_TimeSpan_SelectsCorrectTime(int? runTimeSeconds, long expectedSeconds){- MediaStream targetStream = new () { Type = MediaStreamType.Video, Index = 0 };+ MediaStream targetStream = new() { Type = MediaStreamType.Video, Index = 0 };var input = new Movie{DefaultVideoStreamIndex = 0,diff --git a/tests/Jellyfin.Server.Implementations.Tests/Data/SqliteItemRepositoryTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Data/SqliteItemRepositoryTests.csindex 6337dea412..4c7c56311b 100644--- a/tests/Jellyfin.Server.Implementations.Tests/Data/SqliteItemRepositoryTests.cs+++ b/tests/Jellyfin.Server.Implementations.Tests/Data/SqliteItemRepositoryTests.cs@@ -173,7 +173,7 @@ namespace Jellyfin.Server.Implementations.Tests.Data"/mnt/series/Family Guy/Season 1/Family Guy - S01E01-thumb.jpg*637452096478512963*Primary*1920*1080*WjQbtJtSO8nhNZ%L_Io#R/oaS6o}-;adXAoIn7j[%hW9s:WGw[nN|test|1234||ss",new ItemImageInfo[]{- new ()+ new(){Path = "/mnt/series/Family Guy/Season 1/Family Guy - S01E01-thumb.jpg",Type = ImageType.Primary,diff --git a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csprojindex 028ebdf554..f9228b1a78 100644--- a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj+++ b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj@@ -32,7 +32,7 @@<!-- Code Analyzers --><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/tests/Jellyfin.Server.Implementations.Tests/Library/EpisodeResolverTest.cs b/tests/Jellyfin.Server.Implementations.Tests/Library/EpisodeResolverTest.csindex 362c3216f2..5c7c983c22 100644--- a/tests/Jellyfin.Server.Implementations.Tests/Library/EpisodeResolverTest.cs+++ b/tests/Jellyfin.Server.Implementations.Tests/Library/EpisodeResolverTest.cs@@ -14,7 +14,7 @@ namespace Jellyfin.Server.Implementations.Tests.Library{public class EpisodeResolverTest{- private static readonly NamingOptions _namingOptions = new ();+ private static readonly NamingOptions _namingOptions = new();[Fact]public void Resolve_GivenVideoInExtrasFolder_DoesNotResolveToEpisode()@@ -65,7 +65,7 @@ namespace Jellyfin.Server.Implementations.Tests.Library{}- protected override TVideoType ResolveVideo<TVideoType>(ItemResolveArgs args, bool parseName) => new ();+ protected override TVideoType ResolveVideo<TVideoType>(ItemResolveArgs args, bool parseName) => new();}}}diff --git a/tests/Jellyfin.Server.Implementations.Tests/Library/LibraryManager/FindExtrasTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Library/LibraryManager/FindExtrasTests.csindex b29426d855..ccff95313b 100644--- a/tests/Jellyfin.Server.Implementations.Tests/Library/LibraryManager/FindExtrasTests.cs+++ b/tests/Jellyfin.Server.Implementations.Tests/Library/LibraryManager/FindExtrasTests.cs@@ -97,7 +97,7 @@ public class FindExtrasTestsfalse)).Returns(new List<FileSystemMetadata>{- new ()+ new(){FullName = "/movies/Up/trailers/some trailer.mkv",Name = "some trailer.mkv",@@ -112,7 +112,7 @@ public class FindExtrasTestsfalse)).Returns(new List<FileSystemMetadata>{- new ()+ new(){FullName = "/movies/Up/behind the scenes/the making of Up.mkv",Name = "the making of Up.mkv",@@ -127,7 +127,7 @@ public class FindExtrasTestsfalse)).Returns(new List<FileSystemMetadata>{- new ()+ new(){FullName = "/movies/Up/theme-music/theme2.mp3",Name = "theme2.mp3",diff --git a/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs b/tests/Jellyfin.Server.Integration.Tests/AuthHelper.csindex 21131eb97f..79c11a8656 100644--- a/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs+++ b/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs@@ -1,8 +1,8 @@using System;using System.Net;using System.Net.Http;-using System.Net.Http.Json;using System.Net.Http.Headers;+using System.Net.Http.Json;using System.Text.Json;using System.Threading.Tasks;using Jellyfin.Api.Models.StartupDtos;diff --git a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csprojindex a59900b029..e8fc495f94 100644--- a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj+++ b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj@@ -29,7 +29,7 @@<!-- Code Analyzers --><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/tests/Jellyfin.Server.Integration.Tests/WebSocketTests.cs b/tests/Jellyfin.Server.Integration.Tests/WebSocketTests.csindex ffdc04ebaf..1a1033443d 100644--- a/tests/Jellyfin.Server.Integration.Tests/WebSocketTests.cs+++ b/tests/Jellyfin.Server.Integration.Tests/WebSocketTests.cs@@ -26,7 +26,8 @@ namespace Jellyfin.Server.Integration.Tests{Scheme = "ws",Path = "websocket"- }.Uri, CancellationToken.None));+ }.Uri,+ CancellationToken.None));}}}diff --git a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csprojindex ada9034dff..b25b06c7b2 100644--- a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj+++ b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj@@ -22,7 +22,7 @@<!-- Code Analyzers --><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>diff --git a/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj b/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csprojindex edf9e0fefb..55cdfa2e01 100644--- a/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj+++ b/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj@@ -23,7 +23,7 @@<!-- Code Analyzers --><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /><PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /></ItemGroup>