Browse Source

update dependencies and fix some types (#1077)

pull/1079/head
Jason Dove 4 years ago committed by GitHub
parent
commit
622fa01602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ErsatzTV-Windows/ErsatzTV-Windows.csproj
  2. 2
      ErsatzTV.Application/ErsatzTV.Application.csproj
  3. 2
      ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj
  4. 5
      ErsatzTV.Core/Interfaces/Repositories/IMediaItemRepository.cs
  5. 23
      ErsatzTV.Core/Metadata/LocalFolderScanner.cs
  6. 5
      ErsatzTV.Core/Metadata/MovieFolderScanner.cs
  7. 2
      ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj
  8. 7
      ErsatzTV.Infrastructure/Data/Repositories/MediaItemRepository.cs
  9. 2
      ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj

2
ErsatzTV-Windows/ErsatzTV-Windows.csproj

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CliWrap" Version="3.5.0" />
<PackageReference Include="CliWrap" Version="3.6.0" />
</ItemGroup>
<ItemGroup>

2
ErsatzTV.Application/ErsatzTV.Application.csproj

@ -8,7 +8,7 @@ @@ -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" />

2
ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj

@ -8,7 +8,7 @@ @@ -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" />

5
ErsatzTV.Core/Interfaces/Repositories/IMediaItemRepository.cs

@ -1,4 +1,5 @@ @@ -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 @@ -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);
}

23
ErsatzTV.Core/Metadata/LocalFolderScanner.cs

@ -1,4 +1,5 @@ @@ -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; @@ -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;

5
ErsatzTV.Core/Metadata/MovieFolderScanner.cs

@ -1,4 +1,5 @@ @@ -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 @@ -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;

2
ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj

@ -7,7 +7,7 @@ @@ -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" />

7
ErsatzTV.Infrastructure/Data/Repositories/MediaItemRepository.cs

@ -1,4 +1,5 @@ @@ -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 @@ -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 @@ -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)

2
ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj

@ -9,7 +9,7 @@ @@ -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" />

Loading…
Cancel
Save