aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Common')
-rw-r--r--MediaBrowser.Common/Events/EventHelper.cs4
-rw-r--r--MediaBrowser.Common/Extensions/HttpContextExtensions.cs4
-rw-r--r--MediaBrowser.Common/MediaBrowser.Common.csproj8
-rw-r--r--MediaBrowser.Common/Plugins/BasePluginOfT.cs4
-rw-r--r--MediaBrowser.Common/Plugins/LocalPlugin.cs8
5 files changed, 14 insertions, 14 deletions
diff --git a/MediaBrowser.Common/Events/EventHelper.cs b/MediaBrowser.Common/Events/EventHelper.cs
index a9cf86fbc..0e495f4fa 100644
--- a/MediaBrowser.Common/Events/EventHelper.cs
+++ b/MediaBrowser.Common/Events/EventHelper.cs
@@ -19,7 +19,7 @@ namespace MediaBrowser.Common.Events
/// <param name="logger">The logger.</param>
public static void QueueEventIfNotNull(EventHandler? handler, object sender, EventArgs args, ILogger logger)
{
- if (handler != null)
+ if (handler is not null)
{
Task.Run(() =>
{
@@ -45,7 +45,7 @@ namespace MediaBrowser.Common.Events
/// <param name="logger">The logger.</param>
public static void QueueEventIfNotNull<T>(EventHandler<T>? handler, object sender, T args, ILogger logger)
{
- if (handler != null)
+ if (handler is not null)
{
Task.Run(() =>
{
diff --git a/MediaBrowser.Common/Extensions/HttpContextExtensions.cs b/MediaBrowser.Common/Extensions/HttpContextExtensions.cs
index 1e5877c84..6608704c0 100644
--- a/MediaBrowser.Common/Extensions/HttpContextExtensions.cs
+++ b/MediaBrowser.Common/Extensions/HttpContextExtensions.cs
@@ -15,8 +15,8 @@ namespace MediaBrowser.Common.Extensions
/// <returns><c>true</c> if the request is coming from LAN, <c>false</c> otherwise.</returns>
public static bool IsLocal(this HttpContext context)
{
- return (context.Connection.LocalIpAddress == null
- && context.Connection.RemoteIpAddress == null)
+ return (context.Connection.LocalIpAddress is null
+ && context.Connection.RemoteIpAddress is null)
|| Equals(context.Connection.LocalIpAddress, context.Connection.RemoteIpAddress);
}
diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj
index 7a55f398a..0296974b5 100644
--- a/MediaBrowser.Common/MediaBrowser.Common.csproj
+++ b/MediaBrowser.Common/MediaBrowser.Common.csproj
@@ -19,8 +19,8 @@
</ItemGroup>
<ItemGroup>
- <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
- <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
+ <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
+ <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>
@@ -29,7 +29,7 @@
</ItemGroup>
<PropertyGroup>
- <TargetFramework>net6.0</TargetFramework>
+ <TargetFramework>net7.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
@@ -39,7 +39,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Stability)'=='Unstable'">
diff --git a/MediaBrowser.Common/Plugins/BasePluginOfT.cs b/MediaBrowser.Common/Plugins/BasePluginOfT.cs
index 0da5592d3..152fa8b4a 100644
--- a/MediaBrowser.Common/Plugins/BasePluginOfT.cs
+++ b/MediaBrowser.Common/Plugins/BasePluginOfT.cs
@@ -47,7 +47,7 @@ namespace MediaBrowser.Common.Plugins
var assemblyFilePath = assembly.Location;
var dataFolderPath = Path.Combine(ApplicationPaths.PluginsPath, Path.GetFileNameWithoutExtension(assemblyFilePath));
- if (Version != null && !Directory.Exists(dataFolderPath))
+ if (Version is not null && !Directory.Exists(dataFolderPath))
{
// Try again with the version number appended to the folder name.
dataFolderPath += "_" + Version.ToString();
@@ -103,7 +103,7 @@ namespace MediaBrowser.Common.Plugins
get
{
// Lazy load
- if (_configuration == null)
+ if (_configuration is null)
{
lock (_configurationSyncLock)
{
diff --git a/MediaBrowser.Common/Plugins/LocalPlugin.cs b/MediaBrowser.Common/Plugins/LocalPlugin.cs
index 4c8e2d504..96af423cc 100644
--- a/MediaBrowser.Common/Plugins/LocalPlugin.cs
+++ b/MediaBrowser.Common/Plugins/LocalPlugin.cs
@@ -43,7 +43,7 @@ namespace MediaBrowser.Common.Plugins
{
get
{
- if (_version == null)
+ if (_version is null)
{
_version = Version.Parse(Manifest.Version);
}
@@ -85,9 +85,9 @@ namespace MediaBrowser.Common.Plugins
/// <returns>Comparison result.</returns>
public static int Compare(LocalPlugin a, LocalPlugin b)
{
- if (a == null || b == null)
+ if (a is null || b is null)
{
- throw new ArgumentNullException(a == null ? nameof(a) : nameof(b));
+ throw new ArgumentNullException(a is null ? nameof(a) : nameof(b));
}
var compare = string.Compare(a.Name, b.Name, StringComparison.OrdinalIgnoreCase);
@@ -128,7 +128,7 @@ namespace MediaBrowser.Common.Plugins
/// <inheritdoc />
public bool Equals(LocalPlugin? other)
{
- if (other == null)
+ if (other is null)
{
return false;
}