From 41bbb4fde11a0f450bbe44f91dc49316de2a1aa2 Mon Sep 17 00:00:00 2001 From: Jason Dove Date: Sat, 6 Mar 2021 16:04:03 -0600 Subject: [PATCH] code cleanup --- .../FFmpeg/FFmpegComplexFilterBuilderTests.cs | 7 +- .../FFmpegPlaybackSettingsServiceTests.cs | 2 +- .../FFmpeg/FFmpegComplexFilterBuilder.cs | 2 +- ...5_Add_FFmpegProfileHardwareAcceleration.cs | 18 +- .../Migrations/TvContextModelSnapshot.cs | 380 ++++++++++++------ .../FFmpegProfileEditViewModelValidator.cs | 5 +- 6 files changed, 273 insertions(+), 141 deletions(-) diff --git a/ErsatzTV.Core.Tests/FFmpeg/FFmpegComplexFilterBuilderTests.cs b/ErsatzTV.Core.Tests/FFmpeg/FFmpegComplexFilterBuilderTests.cs index b992fa39f..48385fc9d 100644 --- a/ErsatzTV.Core.Tests/FFmpeg/FFmpegComplexFilterBuilderTests.cs +++ b/ErsatzTV.Core.Tests/FFmpeg/FFmpegComplexFilterBuilderTests.cs @@ -133,7 +133,12 @@ namespace ErsatzTV.Core.Tests.FFmpeg true, "[0:v]deinterlace_qsv,scale_qsv=w=1920:h=1000,hwdownload,format=nv12,setsar=1,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,hwupload=extra_hw_frames=64[v]", "[v]")] - [TestCase(false, true, false, "[0:v]scale_qsv=w=1920:h=1000,hwdownload,format=nv12,setsar=1,hwupload=extra_hw_frames=64[v]", "[v]")] + [TestCase( + false, + true, + false, + "[0:v]scale_qsv=w=1920:h=1000,hwdownload,format=nv12,setsar=1,hwupload=extra_hw_frames=64[v]", + "[v]")] [TestCase( false, false, diff --git a/ErsatzTV.Core.Tests/FFmpeg/FFmpegPlaybackSettingsServiceTests.cs b/ErsatzTV.Core.Tests/FFmpeg/FFmpegPlaybackSettingsServiceTests.cs index 97afecab9..5f6ed673b 100644 --- a/ErsatzTV.Core.Tests/FFmpeg/FFmpegPlaybackSettingsServiceTests.cs +++ b/ErsatzTV.Core.Tests/FFmpeg/FFmpegPlaybackSettingsServiceTests.cs @@ -273,7 +273,7 @@ namespace ErsatzTV.Core.Tests.FFmpeg actual.ScaledSize.IsNone.Should().BeTrue(); actual.PadToDesiredResolution.Should().BeFalse(); } - + [Test] public void Should_NotPadToDesiredResolution_When_NotNormalizingResolution() { diff --git a/ErsatzTV.Core/FFmpeg/FFmpegComplexFilterBuilder.cs b/ErsatzTV.Core/FFmpeg/FFmpegComplexFilterBuilder.cs index f529d97c8..19e2d0187 100644 --- a/ErsatzTV.Core/FFmpeg/FFmpegComplexFilterBuilder.cs +++ b/ErsatzTV.Core/FFmpeg/FFmpegComplexFilterBuilder.cs @@ -105,7 +105,7 @@ namespace ErsatzTV.Core.FFmpeg if (acceleration != HardwareAccelerationKind.None) { filterQueue.Add("hwdownload"); - if ((_scaleToSize.IsNone && acceleration == HardwareAccelerationKind.Nvenc) || + if (_scaleToSize.IsNone && acceleration == HardwareAccelerationKind.Nvenc || acceleration == HardwareAccelerationKind.Qsv) { filterQueue.Add("format=nv12"); diff --git a/ErsatzTV.Infrastructure/Migrations/20210302224925_Add_FFmpegProfileHardwareAcceleration.cs b/ErsatzTV.Infrastructure/Migrations/20210302224925_Add_FFmpegProfileHardwareAcceleration.cs index 07fb3becf..6e91b2c78 100644 --- a/ErsatzTV.Infrastructure/Migrations/20210302224925_Add_FFmpegProfileHardwareAcceleration.cs +++ b/ErsatzTV.Infrastructure/Migrations/20210302224925_Add_FFmpegProfileHardwareAcceleration.cs @@ -4,21 +4,17 @@ namespace ErsatzTV.Infrastructure.Migrations { public partial class Add_FFmpegProfileHardwareAcceleration : Migration { - protected override void Up(MigrationBuilder migrationBuilder) - { + protected override void Up(MigrationBuilder migrationBuilder) => migrationBuilder.AddColumn( - name: "HardwareAcceleration", - table: "FFmpegProfile", - type: "INTEGER", + "HardwareAcceleration", + "FFmpegProfile", + "INTEGER", nullable: false, defaultValue: 0); - } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropColumn( - name: "HardwareAcceleration", - table: "FFmpegProfile"); - } + "HardwareAcceleration", + "FFmpegProfile"); } } diff --git a/ErsatzTV.Infrastructure/Migrations/TvContextModelSnapshot.cs b/ErsatzTV.Infrastructure/Migrations/TvContextModelSnapshot.cs index b71540915..b11a68a08 100644 --- a/ErsatzTV.Infrastructure/Migrations/TvContextModelSnapshot.cs +++ b/ErsatzTV.Infrastructure/Migrations/TvContextModelSnapshot.cs @@ -1,14 +1,14 @@ // + using System; using ErsatzTV.Infrastructure.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace ErsatzTV.Infrastructure.Migrations { [DbContext(typeof(TvContext))] - partial class TvContextModelSnapshot : ModelSnapshot + internal class TvContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { @@ -16,7 +16,9 @@ namespace ErsatzTV.Infrastructure.Migrations modelBuilder .HasAnnotation("ProductVersion", "5.0.3"); - modelBuilder.Entity("ErsatzTV.Core.Domain.Artwork", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Artwork", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -64,7 +66,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("Artwork"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Channel", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -95,7 +99,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("Channel"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Collection", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Collection", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -109,7 +115,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("Collection"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.CollectionItem", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.CollectionItem", + b => { b.Property("CollectionId") .HasColumnType("INTEGER"); @@ -124,7 +132,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("CollectionItem"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ConfigElement", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.ConfigElement", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -144,7 +154,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("ConfigElement"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.EpisodeMetadata", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.EpisodeMetadata", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -193,7 +205,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("EpisodeMetadata"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.FFmpegProfile", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.FFmpegProfile", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -260,7 +274,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("FFmpegProfile"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Library", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Library", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -285,7 +301,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("Library"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.LibraryPath", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.LibraryPath", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -304,7 +322,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("LibraryPath"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.MediaFile", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.MediaFile", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -326,7 +346,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("MediaFile"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.MediaItem", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -342,7 +364,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("MediaItem"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.MediaSource", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.MediaSource", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -353,7 +377,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("MediaSource"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.MediaVersion", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.MediaVersion", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -407,7 +433,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("MediaVersion"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.MovieMetadata", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.MovieMetadata", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -456,7 +484,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("MovieMetadata"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Playout", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -480,7 +510,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("Playout"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutItem", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlayoutItem", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -507,7 +539,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("PlayoutItem"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -541,7 +575,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("PlayoutProgramScheduleAnchor"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlexConnection", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlexConnection", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -563,7 +599,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("PlexConnection"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlexPathReplacement", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlexPathReplacement", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -585,7 +623,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("PlexPathReplacement"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramSchedule", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.ProgramSchedule", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -605,7 +645,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("ProgramSchedule"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItem", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.ProgramScheduleItem", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -640,7 +682,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("ProgramScheduleItem"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Resolution", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Resolution", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -660,7 +704,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("Resolution"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.SeasonMetadata", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.SeasonMetadata", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -703,7 +749,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("SeasonMetadata"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ShowMetadata", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.ShowMetadata", + b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -752,14 +800,18 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("ShowMetadata"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.LocalLibrary", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.LocalLibrary", + b => { b.HasBaseType("ErsatzTV.Core.Domain.Library"); b.ToTable("LocalLibrary"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlexLibrary", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlexLibrary", + b => { b.HasBaseType("ErsatzTV.Core.Domain.Library"); @@ -772,7 +824,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("PlexLibrary"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaFile", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlexMediaFile", + b => { b.HasBaseType("ErsatzTV.Core.Domain.MediaFile"); @@ -785,7 +839,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("PlexMediaFile"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Episode", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Episode", + b => { b.HasBaseType("ErsatzTV.Core.Domain.MediaItem"); @@ -800,14 +856,18 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("Episode"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Movie", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Movie", + b => { b.HasBaseType("ErsatzTV.Core.Domain.MediaItem"); b.ToTable("Movie"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Season", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Season", + b => { b.HasBaseType("ErsatzTV.Core.Domain.MediaItem"); @@ -822,21 +882,27 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("Season"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Show", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Show", + b => { b.HasBaseType("ErsatzTV.Core.Domain.MediaItem"); b.ToTable("Show"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.LocalMediaSource", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.LocalMediaSource", + b => { b.HasBaseType("ErsatzTV.Core.Domain.MediaSource"); b.ToTable("LocalMediaSource"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlexMediaSource", + b => { b.HasBaseType("ErsatzTV.Core.Domain.MediaSource"); @@ -852,7 +918,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("PlexMediaSource"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.ProgramScheduleItemDuration", + b => { b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); @@ -865,14 +933,18 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("ProgramScheduleDurationItem"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.ProgramScheduleItemFlood", + b => { b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); b.ToTable("ProgramScheduleFloodItem"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", + b => { b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); @@ -882,14 +954,18 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("ProgramScheduleMultipleItem"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemOne", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.ProgramScheduleItemOne", + b => { b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); b.ToTable("ProgramScheduleOneItem"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMovie", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlexMovie", + b => { b.HasBaseType("ErsatzTV.Core.Domain.Movie"); @@ -899,7 +975,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.ToTable("PlexMovie"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Artwork", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Artwork", + b => { b.HasOne("ErsatzTV.Core.Domain.Channel", null) .WithMany("Artwork") @@ -927,7 +1005,9 @@ namespace ErsatzTV.Infrastructure.Migrations .OnDelete(DeleteBehavior.Cascade); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Channel", + b => { b.HasOne("ErsatzTV.Core.Domain.FFmpegProfile", "FFmpegProfile") .WithMany() @@ -938,7 +1018,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("FFmpegProfile"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.CollectionItem", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.CollectionItem", + b => { b.HasOne("ErsatzTV.Core.Domain.Collection", "Collection") .WithMany("CollectionItems") @@ -957,7 +1039,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("MediaItem"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.EpisodeMetadata", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.EpisodeMetadata", + b => { b.HasOne("ErsatzTV.Core.Domain.Episode", "Episode") .WithMany("EpisodeMetadata") @@ -968,7 +1052,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("Episode"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.FFmpegProfile", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.FFmpegProfile", + b => { b.HasOne("ErsatzTV.Core.Domain.Resolution", "Resolution") .WithMany() @@ -979,7 +1065,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("Resolution"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Library", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Library", + b => { b.HasOne("ErsatzTV.Core.Domain.MediaSource", "MediaSource") .WithMany("Libraries") @@ -990,7 +1078,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("MediaSource"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.LibraryPath", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.LibraryPath", + b => { b.HasOne("ErsatzTV.Core.Domain.Library", "Library") .WithMany("Paths") @@ -1001,7 +1091,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("Library"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.MediaFile", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.MediaFile", + b => { b.HasOne("ErsatzTV.Core.Domain.MediaVersion", "MediaVersion") .WithMany("MediaFiles") @@ -1012,7 +1104,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("MediaVersion"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.MediaItem", + b => { b.HasOne("ErsatzTV.Core.Domain.LibraryPath", "LibraryPath") .WithMany("MediaItems") @@ -1023,7 +1117,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("LibraryPath"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.MediaVersion", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.MediaVersion", + b => { b.HasOne("ErsatzTV.Core.Domain.Episode", null) .WithMany("MediaVersions") @@ -1036,7 +1132,9 @@ namespace ErsatzTV.Infrastructure.Migrations .OnDelete(DeleteBehavior.Cascade); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.MovieMetadata", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.MovieMetadata", + b => { b.HasOne("ErsatzTV.Core.Domain.Movie", "Movie") .WithMany("MovieMetadata") @@ -1047,7 +1145,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("Movie"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Playout", + b => { b.HasOne("ErsatzTV.Core.Domain.Channel", "Channel") .WithMany("Playouts") @@ -1061,7 +1161,10 @@ namespace ErsatzTV.Infrastructure.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.OwnsOne("ErsatzTV.Core.Domain.PlayoutAnchor", "Anchor", b1 => + b.OwnsOne( + "ErsatzTV.Core.Domain.PlayoutAnchor", + "Anchor", + b1 => { b1.Property("PlayoutId") .HasColumnType("INTEGER"); @@ -1097,7 +1200,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("ProgramSchedule"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutItem", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlayoutItem", + b => { b.HasOne("ErsatzTV.Core.Domain.MediaItem", "MediaItem") .WithMany() @@ -1116,7 +1221,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("Playout"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", + b => { b.HasOne("ErsatzTV.Core.Domain.Collection", "Collection") .WithMany() @@ -1140,7 +1247,10 @@ namespace ErsatzTV.Infrastructure.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.OwnsOne("ErsatzTV.Core.Domain.CollectionEnumeratorState", "EnumeratorState", b1 => + b.OwnsOne( + "ErsatzTV.Core.Domain.CollectionEnumeratorState", + "EnumeratorState", + b1 => { b1.Property("PlayoutProgramScheduleAnchorId") .HasColumnType("INTEGER"); @@ -1170,7 +1280,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("ProgramSchedule"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlexConnection", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlexConnection", + b => { b.HasOne("ErsatzTV.Core.Domain.PlexMediaSource", "PlexMediaSource") .WithMany("Connections") @@ -1181,7 +1293,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("PlexMediaSource"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlexPathReplacement", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlexPathReplacement", + b => { b.HasOne("ErsatzTV.Core.Domain.PlexMediaSource", "PlexMediaSource") .WithMany("PathReplacements") @@ -1192,7 +1306,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("PlexMediaSource"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItem", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.ProgramScheduleItem", + b => { b.HasOne("ErsatzTV.Core.Domain.Collection", "Collection") .WithMany() @@ -1217,7 +1333,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("ProgramSchedule"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.SeasonMetadata", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.SeasonMetadata", + b => { b.HasOne("ErsatzTV.Core.Domain.Season", "Season") .WithMany("SeasonMetadata") @@ -1228,7 +1346,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("Season"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ShowMetadata", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.ShowMetadata", + b => { b.HasOne("ErsatzTV.Core.Domain.Show", "Show") .WithMany("ShowMetadata") @@ -1239,7 +1359,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("Show"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.LocalLibrary", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.LocalLibrary", + b => { b.HasOne("ErsatzTV.Core.Domain.Library", null) .WithOne() @@ -1248,7 +1370,9 @@ namespace ErsatzTV.Infrastructure.Migrations .IsRequired(); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlexLibrary", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlexLibrary", + b => { b.HasOne("ErsatzTV.Core.Domain.Library", null) .WithOne() @@ -1257,7 +1381,9 @@ namespace ErsatzTV.Infrastructure.Migrations .IsRequired(); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaFile", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlexMediaFile", + b => { b.HasOne("ErsatzTV.Core.Domain.MediaFile", null) .WithOne() @@ -1266,7 +1392,9 @@ namespace ErsatzTV.Infrastructure.Migrations .IsRequired(); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Episode", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Episode", + b => { b.HasOne("ErsatzTV.Core.Domain.MediaItem", null) .WithOne() @@ -1283,7 +1411,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("Season"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Movie", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Movie", + b => { b.HasOne("ErsatzTV.Core.Domain.MediaItem", null) .WithOne() @@ -1292,7 +1422,9 @@ namespace ErsatzTV.Infrastructure.Migrations .IsRequired(); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Season", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Season", + b => { b.HasOne("ErsatzTV.Core.Domain.MediaItem", null) .WithOne() @@ -1309,7 +1441,9 @@ namespace ErsatzTV.Infrastructure.Migrations b.Navigation("Show"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Show", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Show", + b => { b.HasOne("ErsatzTV.Core.Domain.MediaItem", null) .WithOne() @@ -1318,7 +1452,9 @@ namespace ErsatzTV.Infrastructure.Migrations .IsRequired(); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.LocalMediaSource", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.LocalMediaSource", + b => { b.HasOne("ErsatzTV.Core.Domain.MediaSource", null) .WithOne() @@ -1327,7 +1463,9 @@ namespace ErsatzTV.Infrastructure.Migrations .IsRequired(); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlexMediaSource", + b => { b.HasOne("ErsatzTV.Core.Domain.MediaSource", null) .WithOne() @@ -1336,7 +1474,9 @@ namespace ErsatzTV.Infrastructure.Migrations .IsRequired(); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.ProgramScheduleItemDuration", + b => { b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) .WithOne() @@ -1345,7 +1485,9 @@ namespace ErsatzTV.Infrastructure.Migrations .IsRequired(); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.ProgramScheduleItemFlood", + b => { b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) .WithOne() @@ -1354,7 +1496,9 @@ namespace ErsatzTV.Infrastructure.Migrations .IsRequired(); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", + b => { b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) .WithOne() @@ -1363,7 +1507,9 @@ namespace ErsatzTV.Infrastructure.Migrations .IsRequired(); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemOne", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.ProgramScheduleItemOne", + b => { b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) .WithOne() @@ -1372,7 +1518,9 @@ namespace ErsatzTV.Infrastructure.Migrations .IsRequired(); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMovie", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlexMovie", + b => { b.HasOne("ErsatzTV.Core.Domain.Movie", null) .WithOne() @@ -1381,106 +1529,92 @@ namespace ErsatzTV.Infrastructure.Migrations .IsRequired(); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Channel", + b => { b.Navigation("Artwork"); b.Navigation("Playouts"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Collection", b => - { - b.Navigation("CollectionItems"); - }); + modelBuilder.Entity("ErsatzTV.Core.Domain.Collection", b => { b.Navigation("CollectionItems"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.EpisodeMetadata", b => - { - b.Navigation("Artwork"); - }); + modelBuilder.Entity("ErsatzTV.Core.Domain.EpisodeMetadata", b => { b.Navigation("Artwork"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Library", b => - { - b.Navigation("Paths"); - }); + modelBuilder.Entity("ErsatzTV.Core.Domain.Library", b => { b.Navigation("Paths"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.LibraryPath", b => - { - b.Navigation("MediaItems"); - }); + modelBuilder.Entity("ErsatzTV.Core.Domain.LibraryPath", b => { b.Navigation("MediaItems"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b => - { - b.Navigation("CollectionItems"); - }); + modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b => { b.Navigation("CollectionItems"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.MediaSource", b => - { - b.Navigation("Libraries"); - }); + modelBuilder.Entity("ErsatzTV.Core.Domain.MediaSource", b => { b.Navigation("Libraries"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.MediaVersion", b => - { - b.Navigation("MediaFiles"); - }); + modelBuilder.Entity("ErsatzTV.Core.Domain.MediaVersion", b => { b.Navigation("MediaFiles"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.MovieMetadata", b => - { - b.Navigation("Artwork"); - }); + modelBuilder.Entity("ErsatzTV.Core.Domain.MovieMetadata", b => { b.Navigation("Artwork"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Playout", + b => { b.Navigation("Items"); b.Navigation("ProgramScheduleAnchors"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramSchedule", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.ProgramSchedule", + b => { b.Navigation("Items"); b.Navigation("Playouts"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.SeasonMetadata", b => - { - b.Navigation("Artwork"); - }); + modelBuilder.Entity("ErsatzTV.Core.Domain.SeasonMetadata", b => { b.Navigation("Artwork"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.ShowMetadata", b => - { - b.Navigation("Artwork"); - }); + modelBuilder.Entity("ErsatzTV.Core.Domain.ShowMetadata", b => { b.Navigation("Artwork"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Episode", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Episode", + b => { b.Navigation("EpisodeMetadata"); b.Navigation("MediaVersions"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Movie", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Movie", + b => { b.Navigation("MediaVersions"); b.Navigation("MovieMetadata"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Season", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Season", + b => { b.Navigation("Episodes"); b.Navigation("SeasonMetadata"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.Show", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.Show", + b => { b.Navigation("Seasons"); b.Navigation("ShowMetadata"); }); - modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b => + modelBuilder.Entity( + "ErsatzTV.Core.Domain.PlexMediaSource", + b => { b.Navigation("Connections"); diff --git a/ErsatzTV/Validators/FFmpegProfileEditViewModelValidator.cs b/ErsatzTV/Validators/FFmpegProfileEditViewModelValidator.cs index 7bf5fb22b..16230f2e8 100644 --- a/ErsatzTV/Validators/FFmpegProfileEditViewModelValidator.cs +++ b/ErsatzTV/Validators/FFmpegProfileEditViewModelValidator.cs @@ -44,11 +44,8 @@ namespace ErsatzTV.Validators { RuleFor(x => x.VideoCodec).Must(c => NvencEncoders.Contains(c)) .WithMessage("NVENC codec is required (h264_nvenc, hevc_nvenc)"); - - // RuleFor(x => x.NormalizeResolution).Must(x => x == false) - // .WithMessage("Resolution normalization (scaling) is not yet supported with NVENC"); }); - + When( x => x.HardwareAcceleration == HardwareAccelerationKind.Vaapi, () =>