Update StyleCop

This commit is contained in:
Bond_009
2021-12-24 18:28:27 +01:00
parent 2e7d173188
commit cbfa355e31
103 changed files with 550 additions and 465 deletions

View File

@@ -8,4 +8,4 @@ namespace MediaBrowser.Controller.Channels
{
public string UserId { get; set; }
}
}
}

View File

@@ -6,4 +6,4 @@ namespace MediaBrowser.Controller.Channels
{
string[] Attributes { get; }
}
}
}

View File

@@ -12,4 +12,4 @@ namespace MediaBrowser.Controller.Channels
Task DeleteItem(string id, CancellationToken cancellationToken);
}
}
}

View File

@@ -18,4 +18,4 @@ namespace MediaBrowser.Controller.Channels
/// <returns>The latest media.</returns>
Task<IEnumerable<ChannelItemInfo>> GetLatestMedia(ChannelLatestMediaSearch request, CancellationToken cancellationToken);
}
}
}

View File

@@ -21,4 +21,4 @@ namespace MediaBrowser.Controller.Collections
/// <value>The options.</value>
public CollectionCreationOptions Options { get; set; }
}
}
}

View File

@@ -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;

View File

@@ -47,11 +47,12 @@ namespace MediaBrowser.Controller.Entities
if (file.StartsWith("http", StringComparison.OrdinalIgnoreCase))
{
item.SetImage(
new ItemImageInfo
{
Path = file,
Type = imageType
}, 0);
new ItemImageInfo
{
Path = file,
Type = imageType
},
0);
}
else
{

View File

@@ -8,4 +8,4 @@ namespace MediaBrowser.Controller.Entities
{
Share[] Shares { get; set; }
}
}
}

View File

@@ -32,4 +32,4 @@ namespace MediaBrowser.Controller.Entities
return ((obj.Path ?? string.Empty) + (obj.LibraryItemId ?? string.Empty) + obj.Type).GetHashCode(StringComparison.Ordinal);
}
}
}
}

View File

@@ -15,4 +15,4 @@
/// </summary>
Shortcut = 1
}
}
}

View File

@@ -16,4 +16,4 @@ namespace MediaBrowser.Controller.LiveTv
public CancellationTokenSource CancellationTokenSource { get; set; }
}
}
}

View File

@@ -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>

View File

@@ -201,4 +201,4 @@ namespace MediaBrowser.Controller.MediaEncoding
return null;
}
}
}
}

View File

@@ -20,4 +20,4 @@
/// </summary>
Dash
}
}
}

View File

@@ -14,4 +14,4 @@ namespace MediaBrowser.Controller.Net
public long IntervalMs { get; set; }
}
}
}

View File

@@ -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)
{

View File

@@ -20,4 +20,4 @@
/// </summary>
Low = 2
}
}
}