The Free Software Media System - Server Backend & API
Fix all warnings in Jellyfin.Server.Implementations
Bond_0096dbdb4e9af9d
diff --git a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csprojindex c2c3513ad9..bc437c5d77 100644--- a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj+++ b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj@@ -6,10 +6,6 @@<GenerateDocumentationFile>true</GenerateDocumentationFile></PropertyGroup>- <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">- <CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>- </PropertyGroup>-<!-- Code analysers--><ItemGroup Condition=" '$(Configuration)' == 'Debug' "><PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.3">diff --git a/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs b/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.csindex 4fda8f5a41..9601954671 100644--- a/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs+++ b/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs@@ -54,7 +54,8 @@ namespace Jellyfin.Server.Implementations.Usersforeach (var resetFile in Directory.EnumerateFiles(_passwordResetFileBaseDir, $"{BaseResetFileName}*")){SerializablePasswordReset spr;- await using (var str = AsyncFile.OpenRead(resetFile))+ var str = AsyncFile.OpenRead(resetFile);+ await using (str.ConfigureAwait(false)){spr = await JsonSerializer.DeserializeAsync<SerializablePasswordReset>(str).ConfigureAwait(false)?? throw new ResourceNotFoundException($"Provided path ({resetFile}) is not valid.");@@ -107,7 +108,8 @@ namespace Jellyfin.Server.Implementations.UsersUserName = user.Username};- await using (FileStream fileStream = AsyncFile.OpenWrite(filePath))+ FileStream fileStream = AsyncFile.OpenWrite(filePath);+ await using (fileStream.ConfigureAwait(false)){await JsonSerializer.SerializeAsync(fileStream, spr).ConfigureAwait(false);}