update dependencies and fix some types (#1077)

This commit is contained in:
Jason Dove
2022-12-28 14:21:25 -06:00
committed by GitHub
parent e2b3c1ce8e
commit 622fa01602
9 changed files with 27 additions and 23 deletions
+1 -1
View File
@@ -17,7 +17,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CliWrap" Version="3.5.0" />
<PackageReference Include="CliWrap" Version="3.6.0" />
</ItemGroup>
<ItemGroup>
@@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Bugsnag" Version="3.1.0" />
<PackageReference Include="CliWrap" Version="3.5.0" />
<PackageReference Include="CliWrap" Version="3.6.0" />
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="MediatR" Version="11.1.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="7.0.0" />
@@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Bugsnag" Version="3.1.0" />
<PackageReference Include="CliWrap" Version="3.5.0" />
<PackageReference Include="CliWrap" Version="3.6.0" />
<PackageReference Include="FluentAssertions" Version="6.8.0" />
<PackageReference Include="LanguageExt.Core" Version="4.4.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
@@ -1,4 +1,5 @@
using System.Globalization;
using System.Collections.Immutable;
using System.Globalization;
using ErsatzTV.Core.Domain;
namespace ErsatzTV.Core.Interfaces.Repositories;
@@ -10,5 +11,5 @@ public interface IMediaItemRepository
Task<List<int>> FlagFileNotFound(LibraryPath libraryPath, string path);
Task<Unit> FlagNormal(MediaItem mediaItem);
Task<Either<BaseError, Unit>> DeleteItems(List<int> mediaItemIds);
Task<List<string>> GetAllTrashedItems(LibraryPath libraryPath);
Task<ImmutableHashSet<string>> GetAllTrashedItems(LibraryPath libraryPath);
}
+12 -11
View File
@@ -1,4 +1,5 @@
using Bugsnag;
using System.Collections.Immutable;
using Bugsnag;
using CliWrap;
using ErsatzTV.Core.Domain;
using ErsatzTV.Core.Extensions;
@@ -13,37 +14,37 @@ namespace ErsatzTV.Core.Metadata;
public abstract class LocalFolderScanner
{
public static readonly List<string> VideoFileExtensions = new()
public static readonly ImmutableHashSet<string> VideoFileExtensions = new[]
{
".mpg", ".mp2", ".mpeg", ".mpe", ".mpv", ".ogg", ".mp4",
".m4p", ".m4v", ".avi", ".wmv", ".mov", ".mkv", ".ts", ".webm"
};
}.ToImmutableHashSet();
public static readonly List<string> AudioFileExtensions = new()
public static readonly ImmutableHashSet<string> AudioFileExtensions = new[]
{
".aac", ".alac", ".dff", ".dsf", ".flac", ".mp3", ".m4a", ".ogg", ".opus", ".oga", ".ogx", ".spx", ".wav",
".wma"
};
}.ToImmutableHashSet();
public static readonly List<string> ImageFileExtensions = new()
public static readonly ImmutableHashSet<string> ImageFileExtensions = new[]
{
"jpg", "jpeg", "png", "gif", "tbn"
};
}.ToImmutableHashSet();
public static readonly List<string> ExtraFiles = new()
public static readonly ImmutableHashSet<string> ExtraFiles = new[]
{
"behindthescenes", "deleted", "featurette",
"interview", "scene", "short", "trailer", "other"
};
}.ToImmutableHashSet();
public static readonly List<string> ExtraDirectories = new List<string>
public static readonly ImmutableHashSet<string> ExtraDirectories = new List<string>
{
"behind the scenes", "deleted scenes", "featurettes",
"interviews", "scenes", "shorts", "trailers", "other",
"extras", "specials"
}
.Map(s => $"{Path.DirectorySeparatorChar}{s}{Path.DirectorySeparatorChar}")
.ToList();
.ToImmutableHashSet();
private readonly IClient _client;
private readonly IFFmpegProcessService _ffmpegProcessService;
+3 -2
View File
@@ -1,4 +1,5 @@
using Bugsnag;
using System.Collections.Immutable;
using Bugsnag;
using ErsatzTV.Core.Domain;
using ErsatzTV.Core.Errors;
using ErsatzTV.Core.Interfaces.FFmpeg;
@@ -81,7 +82,7 @@ public class MovieFolderScanner : LocalFolderScanner, IMovieFolderScanner
{
try
{
List<string> allTrashedItems = await _mediaItemRepository.GetAllTrashedItems(libraryPath);
ImmutableHashSet<string> allTrashedItems = await _mediaItemRepository.GetAllTrashedItems(libraryPath);
decimal progressSpread = progressMax - progressMin;
+1 -1
View File
@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CliWrap" Version="3.5.0" />
<PackageReference Include="CliWrap" Version="3.6.0" />
<PackageReference Include="LanguageExt.Core" Version="4.4.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
@@ -1,4 +1,5 @@
using System.Globalization;
using System.Collections.Immutable;
using System.Globalization;
using Dapper;
using ErsatzTV.Core;
using ErsatzTV.Core.Domain;
@@ -82,7 +83,7 @@ public class MediaItemRepository : IMediaItemRepository
return ids;
}
public async Task<List<string>> GetAllTrashedItems(LibraryPath libraryPath)
public async Task<ImmutableHashSet<string>> GetAllTrashedItems(LibraryPath libraryPath)
{
await using TvContext dbContext = await _dbContextFactory.CreateDbContextAsync();
return await dbContext.Connection.QueryAsync<string>(
@@ -92,7 +93,7 @@ public class MediaItemRepository : IMediaItemRepository
INNER JOIN MediaFile MF on MV.Id = MF.MediaVersionId
WHERE M.State IN (1,2) AND M.LibraryPathId = @LibraryPathId",
new { LibraryPathId = libraryPath.Id })
.Map(list => list.ToList());
.Map(list => list.ToImmutableHashSet());
}
public async Task<Unit> FlagNormal(MediaItem mediaItem)
@@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="Blurhash.ImageSharp" Version="3.0.0" />
<PackageReference Include="CliWrap" Version="3.5.0" />
<PackageReference Include="CliWrap" Version="3.6.0" />
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="Jint" Version="3.0.0-beta-2044" />
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00016" />