Enable TreatWarningsAsErrors for some projects

Analyzers are only run in debug build, so setting TreatWarningsAsErrors
for release build will catch the compiler warnings until we resolve all
analyzer warnings.
This commit is contained in:
Bond_009 2019-12-13 20:11:37 +01:00
parent 54dbdc695a
commit 5a8e972952
51 changed files with 175 additions and 32 deletions

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
namespace Emby.Naming.Audio namespace Emby.Naming.Audio
{ {
public class MultiPartResult public class MultiPartResult

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
namespace Emby.Naming.AudioBook namespace Emby.Naming.AudioBook
{ {
public class AudioBookFilePathParserResult public class AudioBookFilePathParserResult

View File

@ -7,6 +7,9 @@ namespace Emby.Naming.AudioBook
/// </summary> /// </summary>
public class AudioBookInfo public class AudioBookInfo
{ {
/// <summary>
/// Initializes a new instance of the <see cref="AudioBookInfo" /> class.
/// </summary>
public AudioBookInfo() public AudioBookInfo()
{ {
Files = new List<AudioBookFileInfo>(); Files = new List<AudioBookFileInfo>();

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Emby.Naming.Common; using Emby.Naming.Common;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
namespace Emby.Naming.Common namespace Emby.Naming.Common
{ {
public enum MediaType public enum MediaType

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;

View File

@ -6,6 +6,10 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
@ -21,13 +25,13 @@
<RepositoryUrl>https://github.com/jellyfin/jellyfin</RepositoryUrl> <RepositoryUrl>https://github.com/jellyfin/jellyfin</RepositoryUrl>
</PropertyGroup> </PropertyGroup>
<!-- Code analysers--> <!-- Code Analyzers-->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' "> <!-- <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7" PrivateAssets="All" /> <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7" PrivateAssets="All" />
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" /> <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.1.118" PrivateAssets="All" />
<PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /> <PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" />
</ItemGroup> </ItemGroup>-->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet>

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
namespace Emby.Naming.Subtitles namespace Emby.Naming.Subtitles
{ {
public class SubtitleInfo public class SubtitleInfo

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
namespace Emby.Naming.TV namespace Emby.Naming.TV
{ {
public class EpisodeInfo public class EpisodeInfo

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
namespace Emby.Naming.TV namespace Emby.Naming.TV
{ {
public class EpisodePathParserResult public class EpisodePathParserResult

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
namespace Emby.Naming.TV namespace Emby.Naming.TV
{ {
public class SeasonPathParserResult public class SeasonPathParserResult

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
namespace Emby.Naming.Video namespace Emby.Naming.Video
{ {
public class CleanDateTimeResult public class CleanDateTimeResult
@ -7,11 +10,13 @@ namespace Emby.Naming.Video
/// </summary> /// </summary>
/// <value>The name.</value> /// <value>The name.</value>
public string Name { get; set; } public string Name { get; set; }
/// <summary> /// <summary>
/// Gets or sets the year. /// Gets or sets the year.
/// </summary> /// </summary>
/// <value>The year.</value> /// <value>The year.</value>
public int? Year { get; set; } public int? Year { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether this instance has changed. /// Gets or sets a value indicating whether this instance has changed.
/// </summary> /// </summary>

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System.Collections.Generic; using System.Collections.Generic;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
namespace Emby.Naming.Video namespace Emby.Naming.Video
{ {
public class CleanStringResult public class CleanStringResult
@ -7,6 +10,7 @@ namespace Emby.Naming.Video
/// </summary> /// </summary>
/// <value>The name.</value> /// <value>The name.</value>
public string Name { get; set; } public string Name { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether this instance has changed. /// Gets or sets a value indicating whether this instance has changed.
/// </summary> /// </summary>

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
namespace Emby.Naming.Video namespace Emby.Naming.Video
{ {
public class ExtraResult public class ExtraResult
@ -7,6 +10,7 @@ namespace Emby.Naming.Video
/// </summary> /// </summary>
/// <value>The type of the extra.</value> /// <value>The type of the extra.</value>
public string ExtraType { get; set; } public string ExtraType { get; set; }
/// <summary> /// <summary>
/// Gets or sets the rule. /// Gets or sets the rule.
/// </summary> /// </summary>

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using Emby.Naming.Common; using Emby.Naming.Common;
namespace Emby.Naming.Video namespace Emby.Naming.Video
@ -9,16 +12,19 @@ namespace Emby.Naming.Video
/// </summary> /// </summary>
/// <value>The token.</value> /// <value>The token.</value>
public string Token { get; set; } public string Token { get; set; }
/// <summary> /// <summary>
/// Gets or sets the type of the extra. /// Gets or sets the type of the extra.
/// </summary> /// </summary>
/// <value>The type of the extra.</value> /// <value>The type of the extra.</value>
public string ExtraType { get; set; } public string ExtraType { get; set; }
/// <summary> /// <summary>
/// Gets or sets the type of the rule. /// Gets or sets the type of the rule.
/// </summary> /// </summary>
/// <value>The type of the rule.</value> /// <value>The type of the rule.</value>
public ExtraRuleType RuleType { get; set; } public ExtraRuleType RuleType { get; set; }
/// <summary> /// <summary>
/// Gets or sets the type of the media. /// Gets or sets the type of the media.
/// </summary> /// </summary>

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
namespace Emby.Naming.Video namespace Emby.Naming.Video
{ {
public enum ExtraRuleType public enum ExtraRuleType
@ -6,10 +9,12 @@ namespace Emby.Naming.Video
/// The suffix /// The suffix
/// </summary> /// </summary>
Suffix = 0, Suffix = 0,
/// <summary> /// <summary>
/// The filename /// The filename
/// </summary> /// </summary>
Filename = 1, Filename = 1,
/// <summary> /// <summary>
/// The regex /// The regex
/// </summary> /// </summary>

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -6,15 +9,17 @@ namespace Emby.Naming.Video
{ {
public class FileStack public class FileStack
{ {
public string Name { get; set; }
public List<string> Files { get; set; }
public bool IsDirectoryStack { get; set; }
public FileStack() public FileStack()
{ {
Files = new List<string>(); Files = new List<string>();
} }
public string Name { get; set; }
public List<string> Files { get; set; }
public bool IsDirectoryStack { get; set; }
public bool ContainsFile(string file, bool isDirectory) public bool ContainsFile(string file, bool isDirectory)
{ {
if (IsDirectoryStack == isDirectory) if (IsDirectoryStack == isDirectory)

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.IO; using System.IO;
using Emby.Naming.Common; using Emby.Naming.Common;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.Linq; using System.Linq;
using Emby.Naming.Common; using Emby.Naming.Common;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System.Collections.Generic; using System.Collections.Generic;
namespace Emby.Naming.Video namespace Emby.Naming.Video

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
namespace Emby.Naming.Video namespace Emby.Naming.Video
{ {
public class Format3DRule public class Format3DRule
@ -7,6 +10,7 @@ namespace Emby.Naming.Video
/// </summary> /// </summary>
/// <value>The token.</value> /// <value>The token.</value>
public string Token { get; set; } public string Token { get; set; }
/// <summary> /// <summary>
/// Gets or sets the preceeding token. /// Gets or sets the preceeding token.
/// </summary> /// </summary>

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System.Collections.Generic; using System.Collections.Generic;
namespace Emby.Naming.Video namespace Emby.Naming.Video

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
namespace Emby.Naming.Video namespace Emby.Naming.Video
{ {
public struct StubResult public struct StubResult

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
namespace Emby.Naming.Video namespace Emby.Naming.Video
{ {
public class StubTypeRule public class StubTypeRule

View File

@ -77,6 +77,7 @@ namespace Emby.Naming.Video
/// <value>The file name without extension.</value> /// <value>The file name without extension.</value>
public string FileNameWithoutExtension => !IsDirectory ? System.IO.Path.GetFileNameWithoutExtension(Path) : System.IO.Path.GetFileName(Path); public string FileNameWithoutExtension => !IsDirectory ? System.IO.Path.GetFileNameWithoutExtension(Path) : System.IO.Path.GetFileName(Path);
/// <inheritdoc />
public override string ToString() public override string ToString()
{ {
// Makes debugging easier // Makes debugging easier

View File

@ -7,6 +7,16 @@ namespace Emby.Naming.Video
/// </summary> /// </summary>
public class VideoInfo public class VideoInfo
{ {
/// <summary>
/// Initializes a new instance of the <see cref="VideoInfo" /> class.
/// </summary>
public VideoInfo()
{
Files = new List<VideoFileInfo>();
Extras = new List<VideoFileInfo>();
AlternateVersions = new List<VideoFileInfo>();
}
/// <summary> /// <summary>
/// Gets or sets the name. /// Gets or sets the name.
/// </summary> /// </summary>
@ -36,12 +46,5 @@ namespace Emby.Naming.Video
/// </summary> /// </summary>
/// <value>The alternate versions.</value> /// <value>The alternate versions.</value>
public List<VideoFileInfo> AlternateVersions { get; set; } public List<VideoFileInfo> AlternateVersions { get; set; }
public VideoInfo()
{
Files = new List<VideoFileInfo>();
Extras = new List<VideoFileInfo>();
AlternateVersions = new List<VideoFileInfo>();
}
} }
} }

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;

View File

@ -1,5 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" /> <ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" /> <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
@ -20,12 +24,12 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<!-- Code analysers--> <!-- Code Analyzers-->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' "> <!--<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7" /> <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" /> <PackageReference Include="SerilogAnalyzer" Version="0.15.0" />
</ItemGroup> </ItemGroup>-->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet>

View File

@ -50,13 +50,13 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup> </PropertyGroup>
<!-- Code analysers--> <!-- Code Analyzers-->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' "> <!--<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7" /> <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7" />
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" /> <PackageReference Include="SerilogAnalyzer" Version="0.15.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
<PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" /> <PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" />
</ItemGroup> </ItemGroup>-->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet>

View File

@ -392,7 +392,7 @@ namespace Emby.Server.Implementations.Library
if (providers.Length == 0) if (providers.Length == 0)
{ {
// Assign the user to the InvalidAuthProvider since no configured auth provider was valid/found // Assign the user to the InvalidAuthProvider since no configured auth provider was valid/found
_logger.LogWarning("User {UserName} was found with invalid/missing Authentication Provider {AuthenticationProviderId}. Assigning user to InvalidAuthProvider until this is corrected", user.Name, user.Policy.AuthenticationProviderId); _logger.LogWarning("User {UserName} was found with invalid/missing Authentication Provider {AuthenticationProviderId}. Assigning user to InvalidAuthProvider until this is corrected", user?.Name, user?.Policy.AuthenticationProviderId);
providers = new IAuthenticationProvider[] { _invalidAuthProvider }; providers = new IAuthenticationProvider[] { _invalidAuthProvider };
} }
@ -472,7 +472,7 @@ namespace Emby.Server.Implementations.Library
if (!success if (!success
&& _networkManager.IsInLocalNetwork(remoteEndPoint) && _networkManager.IsInLocalNetwork(remoteEndPoint)
&& user.Configuration.EnableLocalPassword && user?.Configuration.EnableLocalPassword == true
&& !string.IsNullOrEmpty(user.EasyPassword)) && !string.IsNullOrEmpty(user.EasyPassword))
{ {
// Check easy password // Check easy password

View File

@ -1,5 +1,6 @@
using System; using System;
using System.IO; using System.IO;
using System.Net.Http;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
@ -74,7 +75,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
DecompressionMethod = CompressionMethod.None DecompressionMethod = CompressionMethod.None
}; };
using (var response = await _httpClient.SendAsync(httpRequestOptions, "GET").ConfigureAwait(false)) using (var response = await _httpClient.SendAsync(httpRequestOptions, HttpMethod.Get).ConfigureAwait(false))
{ {
_logger.LogInformation("Opened recording stream from tuner provider"); _logger.LogInformation("Opened recording stream from tuner provider");

View File

@ -5,6 +5,7 @@ using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Net.Http;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Common; using MediaBrowser.Common;
@ -12,7 +13,6 @@ using MediaBrowser.Common.Net;
using MediaBrowser.Controller.LiveTv; using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.Net; using MediaBrowser.Model.Net;
using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Serialization;
@ -663,7 +663,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
try try
{ {
return await _httpClient.SendAsync(options, "GET").ConfigureAwait(false); return await _httpClient.SendAsync(options, HttpMethod.Get).ConfigureAwait(false);
} }
catch (HttpException ex) catch (HttpException ex)
{ {
@ -738,7 +738,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
httpOptions.RequestHeaders["token"] = token; httpOptions.RequestHeaders["token"] = token;
using (await _httpClient.SendAsync(httpOptions, "PUT").ConfigureAwait(false)) using (await _httpClient.SendAsync(httpOptions, HttpMethod.Put).ConfigureAwait(false))
{ {
} }
} }

View File

@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Net.Http;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Configuration;
@ -64,7 +65,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
httpRequestOptions.RequestHeaders[header.Key] = header.Value; httpRequestOptions.RequestHeaders[header.Key] = header.Value;
} }
var response = await _httpClient.SendAsync(httpRequestOptions, "GET").ConfigureAwait(false); var response = await _httpClient.SendAsync(httpRequestOptions, HttpMethod.Get).ConfigureAwait(false);
var extension = "ts"; var extension = "ts";
var requiresRemux = false; var requiresRemux = false;

View File

@ -1,10 +1,10 @@
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Runtime.CompilerServices;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -189,7 +189,7 @@ namespace Emby.Server.Implementations.Updates
} }
/// <inheritdoc /> /// <inheritdoc />
public async IAsyncEnumerable<PackageVersionInfo> GetAvailablePluginUpdates(CancellationToken cancellationToken = default) public async IAsyncEnumerable<PackageVersionInfo> GetAvailablePluginUpdates([EnumeratorCancellation] CancellationToken cancellationToken = default)
{ {
var catalog = await GetAvailablePackages(cancellationToken).ConfigureAwait(false); var catalog = await GetAvailablePackages(cancellationToken).ConfigureAwait(false);

View File

@ -17,7 +17,7 @@
<ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" /> <ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
</ItemGroup> </ItemGroup>
<!-- Code analysers--> <!-- Code Analyzers-->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' "> <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7" PrivateAssets="All" /> <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7" PrivateAssets="All" />
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" /> <PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />

View File

@ -24,8 +24,8 @@
<ItemGroup> <ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" /> <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup> </ItemGroup>
<!-- Code analyzers--> <!-- Code Analyzers-->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' "> <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7" /> <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7" />
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" /> <PackageReference Include="SerilogAnalyzer" Version="0.15.0" />