mirror of https://github.com/jellyfin/jellyfin.git
Fix some warnings and only disable TreatWarningsAsErrors for CodeAnalysis (#8709)
This commit is contained in:
parent
bf3ff15843
commit
210a4921f2
|
@ -23,7 +23,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Code Analyzers-->
|
<!-- Code Analyzers-->
|
||||||
|
|
|
@ -11,10 +11,6 @@
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
|
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
|
||||||
<ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
|
<ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Stability)'=='Unstable'">
|
<PropertyGroup Condition=" '$(Stability)'=='Unstable'">
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Code Analyzers-->
|
<!-- Code Analyzers-->
|
||||||
|
|
|
@ -243,7 +243,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
|
||||||
{
|
{
|
||||||
Id = c.Id,
|
Id = c.Id,
|
||||||
Name = c.DisplayName,
|
Name = c.DisplayName,
|
||||||
ImageUrl = c.Icon != null && !string.IsNullOrEmpty(c.Icon.Source) ? c.Icon.Source : null,
|
ImageUrl = string.IsNullOrEmpty(c.Icon.Source) ? null : c.Icon.Source,
|
||||||
Number = string.IsNullOrWhiteSpace(c.Number) ? c.Id : c.Number
|
Number = string.IsNullOrWhiteSpace(c.Number) ? c.Id : c.Number
|
||||||
}).ToList();
|
}).ToList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Code analysers-->
|
<!-- Code analysers-->
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Stability)'=='Unstable'">
|
<PropertyGroup Condition=" '$(Stability)'=='Unstable'">
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -2814,7 +2814,6 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
{
|
{
|
||||||
algorithm = "bt.2390";
|
algorithm = "bt.2390";
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (string.Equals(options.TonemappingAlgorithm, "none", StringComparison.OrdinalIgnoreCase))
|
else if (string.Equals(options.TonemappingAlgorithm, "none", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
algorithm = "clip";
|
algorithm = "clip";
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
Version EncoderVersion { get; }
|
Version EncoderVersion { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether p key pausing is supported.
|
/// Gets a value indicating whether p key pausing is supported.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value><c>true</c> if p key pausing is supported, <c>false</c> otherwise.</value>
|
/// <value><c>true</c> if p key pausing is supported, <c>false</c> otherwise.</value>
|
||||||
bool IsPkeyPauseSupported { get; }
|
bool IsPkeyPauseSupported { get; }
|
||||||
|
|
|
@ -75,7 +75,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||||
private bool _isVaapiDeviceInteli965 = false;
|
private bool _isVaapiDeviceInteli965 = false;
|
||||||
private bool _isVaapiDeviceSupportVulkanFmtModifier = false;
|
private bool _isVaapiDeviceSupportVulkanFmtModifier = false;
|
||||||
|
|
||||||
private static string[] _vulkanFmtModifierExts = {
|
private static string[] _vulkanFmtModifierExts =
|
||||||
|
{
|
||||||
"VK_KHR_sampler_ycbcr_conversion",
|
"VK_KHR_sampler_ycbcr_conversion",
|
||||||
"VK_EXT_image_drm_format_modifier",
|
"VK_EXT_image_drm_format_modifier",
|
||||||
"VK_KHR_external_memory_fd",
|
"VK_KHR_external_memory_fd",
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Stability)'=='Unstable'">
|
<PropertyGroup Condition=" '$(Stability)'=='Unstable'">
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Code Analyzers-->
|
<!-- Code Analyzers-->
|
||||||
|
|
|
@ -152,6 +152,7 @@ namespace MediaBrowser.Providers.Music
|
||||||
return ItemUpdateType.MetadataEdit;
|
return ItemUpdateType.MetadataEdit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ItemUpdateType.None;
|
return ItemUpdateType.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
<Rule Id="SA1316" Action="Error" />
|
<Rule Id="SA1316" Action="Error" />
|
||||||
<!-- error on SA1414: Tuple types in signatures should have element names -->
|
<!-- error on SA1414: Tuple types in signatures should have element names -->
|
||||||
<Rule Id="SA1414" Action="Error" />
|
<Rule Id="SA1414" Action="Error" />
|
||||||
|
<!-- disable warning SA1513: Closing brace should be followed by blank line -->
|
||||||
|
<Rule Id="SA1513" Action="Error" />
|
||||||
<!-- error on SA1518: File is required to end with a single newline character -->
|
<!-- error on SA1518: File is required to end with a single newline character -->
|
||||||
<Rule Id="SA1518" Action="Error" />
|
<Rule Id="SA1518" Action="Error" />
|
||||||
<!-- error on SA1629: Documentation text should end with a period -->
|
<!-- error on SA1629: Documentation text should end with a period -->
|
||||||
|
|
|
@ -1,18 +1,17 @@
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace Jellyfin.Controller.Tests.Entities
|
namespace Jellyfin.Controller.Tests.Entities;
|
||||||
|
|
||||||
|
public class BaseItemTests
|
||||||
{
|
{
|
||||||
public class BaseItemTests
|
[Theory]
|
||||||
{
|
[InlineData("", "")]
|
||||||
[Theory]
|
[InlineData("1", "0000000001")]
|
||||||
[InlineData("", "")]
|
[InlineData("t", "t")]
|
||||||
[InlineData("1", "0000000001")]
|
[InlineData("test", "test")]
|
||||||
[InlineData("t", "t")]
|
[InlineData("test1", "test0000000001")]
|
||||||
[InlineData("test", "test")]
|
[InlineData("1test 2", "0000000001test 0000000002")]
|
||||||
[InlineData("test1", "test0000000001")]
|
public void BaseItem_ModifySortChunks_Valid(string input, string expected)
|
||||||
[InlineData("1test 2", "0000000001test 0000000002")]
|
=> Assert.Equal(expected, BaseItem.ModifySortChunks(input));
|
||||||
public void BaseItem_ModifySortChunks_Valid(string input, string expected)
|
|
||||||
=> Assert.Equal(expected, BaseItem.ModifySortChunks(input));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue