diff --git a/CHANGELOG.md b/CHANGELOG.md index fc1de1ca4..0abde1d4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Normalize smart quotes in search queries as they are unsupported by the search library - Fix incorrect watermark time calculations caused by working ahead in `HLS Segmenter` - Fix ui crash adding empty path to local library +- Fix ui crash loading collection editor - Properly flag items as `File Not Found` when local library path (folder) is missing from disk - Fix playback bug with unknown pixel format -- Fix playback of interlaced mpeg2video on NVIDIA +- Fix playback of interlaced mpeg2video on NVIDIA, VAAPI ### Added - Include `Series` category tag for all episodes in XMLTV diff --git a/ErsatzTV.Application/MediaCards/Queries/GetCollectionCardsHandler.cs b/ErsatzTV.Application/MediaCards/Queries/GetCollectionCardsHandler.cs index ee397350f..8a118cc30 100644 --- a/ErsatzTV.Application/MediaCards/Queries/GetCollectionCardsHandler.cs +++ b/ErsatzTV.Application/MediaCards/Queries/GetCollectionCardsHandler.cs @@ -47,6 +47,9 @@ namespace ErsatzTV.Application.MediaCards.Queries .ThenInclude(i => (i as Movie).MovieMetadata) .ThenInclude(mm => mm.Artwork) .Include(c => c.MediaItems) + .ThenInclude(i => (i as Movie).MediaVersions) + .ThenInclude(mv => mv.MediaFiles) + .Include(c => c.MediaItems) .ThenInclude(i => (i as Artist).ArtistMetadata) .ThenInclude(mvm => mvm.Artwork) .Include(c => c.MediaItems) @@ -56,6 +59,9 @@ namespace ErsatzTV.Application.MediaCards.Queries .ThenInclude(i => (i as MusicVideo).Artist) .ThenInclude(a => a.ArtistMetadata) .Include(c => c.MediaItems) + .ThenInclude(i => (i as MusicVideo).MediaVersions) + .ThenInclude(mv => mv.MediaFiles) + .Include(c => c.MediaItems) .ThenInclude(i => (i as Show).ShowMetadata) .ThenInclude(sm => sm.Artwork) .Include(c => c.MediaItems) @@ -81,11 +87,20 @@ namespace ErsatzTV.Application.MediaCards.Queries .ThenInclude(i => (i as Episode).Season) .ThenInclude(s => s.SeasonMetadata) .Include(c => c.MediaItems) + .ThenInclude(i => (i as Episode).MediaVersions) + .ThenInclude(mv => mv.MediaFiles) + .Include(c => c.MediaItems) .ThenInclude(i => (i as OtherVideo).OtherVideoMetadata) .ThenInclude(ovm => ovm.Artwork) .Include(c => c.MediaItems) + .ThenInclude(i => (i as OtherVideo).MediaVersions) + .ThenInclude(mv => mv.MediaFiles) + .Include(c => c.MediaItems) .ThenInclude(i => (i as Song).SongMetadata) .ThenInclude(ovm => ovm.Artwork) + .Include(c => c.MediaItems) + .ThenInclude(i => (i as Song).MediaVersions) + .ThenInclude(mv => mv.MediaFiles) .SelectOneAsync(c => c.Id, c => c.Id == request.Id) .Map(c => c.ToEither(BaseError.New("Unable to load collection"))) .MapT(c => ProjectToViewModel(c, maybeJellyfin, maybeEmby)); diff --git a/ErsatzTV.Application/MediaCollections/Queries/GetCollectionByIdHandler.cs b/ErsatzTV.Application/MediaCollections/Queries/GetCollectionByIdHandler.cs index 0f648728e..4d7684d31 100644 --- a/ErsatzTV.Application/MediaCollections/Queries/GetCollectionByIdHandler.cs +++ b/ErsatzTV.Application/MediaCollections/Queries/GetCollectionByIdHandler.cs @@ -21,7 +21,7 @@ namespace ErsatzTV.Application.MediaCollections.Queries GetCollectionById request, CancellationToken cancellationToken) { - await using TvContext dbContext = _dbContextFactory.CreateDbContext(); + await using TvContext dbContext = await _dbContextFactory.CreateDbContextAsync(cancellationToken); return await dbContext.Collections .SelectOneAsync(c => c.Id, c => c.Id == request.Id) .MapT(ProjectToViewModel); diff --git a/ErsatzTV.Core/FFmpeg/FFmpegComplexFilterBuilder.cs b/ErsatzTV.Core/FFmpeg/FFmpegComplexFilterBuilder.cs index 1de58258e..c3970cfdc 100644 --- a/ErsatzTV.Core/FFmpeg/FFmpegComplexFilterBuilder.cs +++ b/ErsatzTV.Core/FFmpeg/FFmpegComplexFilterBuilder.cs @@ -155,7 +155,8 @@ namespace ErsatzTV.Core.FFmpeg bool isHardwareDecode = acceleration switch { - HardwareAccelerationKind.Vaapi => !isSong && _inputCodec != "mpeg4", + HardwareAccelerationKind.Vaapi => !isSong && _inputCodec != "mpeg4" && + (_deinterlace == false || !_pixelFormat.Contains("p10le")), // we need an initial hwupload_cuda when only padding with these pixel formats HardwareAccelerationKind.Nvenc when _scaleToSize.IsNone && _padToSize.IsSome => @@ -252,9 +253,9 @@ namespace ErsatzTV.Core.FFmpeg string[] h264hevc = { "h264", "hevc" }; - if (acceleration == HardwareAccelerationKind.Vaapi && (_pixelFormat ?? string.Empty).EndsWith("p10le") && - h264hevc.Contains(_inputCodec) - && (_pixelFormat != "yuv420p10le" || _inputCodec != "hevc")) + if (_deinterlace == false && acceleration == HardwareAccelerationKind.Vaapi && + (_pixelFormat ?? string.Empty).EndsWith("p10le") && + h264hevc.Contains(_inputCodec) && (_pixelFormat != "yuv420p10le" || _inputCodec != "hevc")) { videoFilterQueue.Add("format=p010le,format=nv12|vaapi,hwupload"); } diff --git a/ErsatzTV.Infrastructure/Data/Repositories/MusicVideoRepository.cs b/ErsatzTV.Infrastructure/Data/Repositories/MusicVideoRepository.cs index 32028b21b..2b62431bb 100644 --- a/ErsatzTV.Infrastructure/Data/Repositories/MusicVideoRepository.cs +++ b/ErsatzTV.Infrastructure/Data/Repositories/MusicVideoRepository.cs @@ -159,7 +159,7 @@ namespace ErsatzTV.Infrastructure.Data.Repositories public async Task> GetPagedMusicVideos(int artistId, int pageNumber, int pageSize) { - await using TvContext dbContext = _dbContextFactory.CreateDbContext(); + await using TvContext dbContext = await _dbContextFactory.CreateDbContextAsync(); return await dbContext.MusicVideoMetadata .AsNoTracking() .Include(m => m.Artwork) diff --git a/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj b/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj index 35332209b..b0e0eaa6e 100644 --- a/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj +++ b/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj @@ -25,7 +25,7 @@ - +