feat: Upgrade Ombi to .NET 6 (#4390)

* chore: updated tfm to net6

* chore: updated main packages

* chore: fixed some warnings

* core: Added workflow_dispatch to some of the CI pipelines [skip ci] (#4392)

* chore: bump the net version

* ci: use the dotnet ver task everywhere
This commit is contained in:
Jamie 2021-11-09 21:54:51 +00:00 committed by GitHub
commit 719eb7dbe3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
60 changed files with 109 additions and 109 deletions

View file

@ -6,16 +6,6 @@ namespace Ombi.Helpers
{
public static class LinqHelpers
{
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
{
HashSet<TKey> knownKeys = new HashSet<TKey>();
foreach (TSource source1 in source)
{
if (knownKeys.Add(keySelector(source1)))
yield return source1;
}
}
public static HashSet<T> ToHashSet<T>(
this IEnumerable<T> source,
IEqualityComparer<T> comparer = null)

View file

@ -53,17 +53,18 @@ namespace Ombi.Helpers
_memoryCache.Set(CacheKey, mediaServiceCache);
}
public async Task Purge()
public Task Purge()
{
var keys = _memoryCache.Get<List<string>>(CacheKey);
if (keys == null)
{
return;
return Task.CompletedTask;
}
foreach (var key in keys)
{
base.Remove(key);
}
return Task.CompletedTask;
}
}

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<FileVersion>3.0.0.0</FileVersion>
<Version></Version>
@ -13,8 +13,8 @@
<ItemGroup>
<PackageReference Include="EasyCrypto" Version="3.3.2" />
<PackageReference Include="LazyCache.AspNetCore" Version="2.1.3" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Nito.AsyncEx" Version="5.1.0" />
<PackageReference Include="Quartz" Version="3.1.0" />