diff --git a/ErsatzTV.Application/ErsatzTV.Application.csproj b/ErsatzTV.Application/ErsatzTV.Application.csproj index fe91c6e59..202bf6a88 100644 --- a/ErsatzTV.Application/ErsatzTV.Application.csproj +++ b/ErsatzTV.Application/ErsatzTV.Application.csproj @@ -8,11 +8,11 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj b/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj index bb061c46f..f077dc7ac 100644 --- a/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj +++ b/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj @@ -8,7 +8,7 @@ - + @@ -16,8 +16,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -25,7 +25,7 @@ - + diff --git a/ErsatzTV.Core/ErsatzTV.Core.csproj b/ErsatzTV.Core/ErsatzTV.Core.csproj index b1fafbb63..6fa12b0b3 100644 --- a/ErsatzTV.Core/ErsatzTV.Core.csproj +++ b/ErsatzTV.Core/ErsatzTV.Core.csproj @@ -18,7 +18,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj b/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj index 5f757df7a..e24a672d7 100644 --- a/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj +++ b/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj b/ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj index 2b1556685..c5843f793 100644 --- a/ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj +++ b/ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj @@ -7,7 +7,7 @@ - + diff --git a/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj b/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj index 4ebd50e4b..ff1a72afc 100644 --- a/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj +++ b/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/ErsatzTV.Infrastructure/Data/Configurations/IntCollectionValueConverter.cs b/ErsatzTV.Infrastructure/Data/Configurations/IntCollectionValueConverter.cs new file mode 100644 index 000000000..9cac4ad71 --- /dev/null +++ b/ErsatzTV.Infrastructure/Data/Configurations/IntCollectionValueConverter.cs @@ -0,0 +1,14 @@ +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace ErsatzTV.Infrastructure.Data.Configurations; + +public class IntCollectionValueConverter : ValueConverter, string> +{ + public IntCollectionValueConverter() : base( + i => string.Join(",", i), + s => string.IsNullOrWhiteSpace(s) + ? Array.Empty() + : s.Split(new[] { ',' }).Select(int.Parse).ToArray()) + { + } +} diff --git a/ErsatzTV.Infrastructure/Data/Configurations/ProgramScheduleAlternateConfiguration.cs b/ErsatzTV.Infrastructure/Data/Configurations/ProgramScheduleAlternateConfiguration.cs index e3363ba29..a9c9b626f 100644 --- a/ErsatzTV.Infrastructure/Data/Configurations/ProgramScheduleAlternateConfiguration.cs +++ b/ErsatzTV.Infrastructure/Data/Configurations/ProgramScheduleAlternateConfiguration.cs @@ -1,7 +1,6 @@ using ErsatzTV.Core.Domain; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace ErsatzTV.Infrastructure.Data.Configurations; @@ -11,24 +10,13 @@ public class ProgramScheduleAlternateConfiguration : IEntityTypeConfiguration, string>( - i => string.Join(",", i), - s => string.IsNullOrWhiteSpace(s) - ? Array.Empty() - : s.Split(new[] { ',' }).Select(int.Parse).ToArray()); - - var intCollectionValueComparer = new CollectionValueComparer(); - builder.Property(t => t.DaysOfMonth) - .HasConversion(intCollectionValueConverter) - .Metadata.SetValueComparer(intCollectionValueComparer); + .HasConversion>(); builder.Property(t => t.MonthsOfYear) - .HasConversion(intCollectionValueConverter) - .Metadata.SetValueComparer(intCollectionValueComparer); + .HasConversion>(); builder.Property(t => t.DaysOfWeek) - .HasConversion(new EnumCollectionJsonValueConverter()) - .Metadata.SetValueComparer(new CollectionValueComparer()); + .HasConversion, CollectionValueComparer>(); } } diff --git a/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj b/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj index e3fff23e9..732df1f7a 100644 --- a/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj +++ b/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj @@ -9,7 +9,7 @@ - + @@ -21,7 +21,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj b/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj index ac9408d99..871de80fb 100644 --- a/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj +++ b/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/ErsatzTV.Scanner/ErsatzTV.Scanner.csproj b/ErsatzTV.Scanner/ErsatzTV.Scanner.csproj index c7ed563d5..9ae51bebf 100644 --- a/ErsatzTV.Scanner/ErsatzTV.Scanner.csproj +++ b/ErsatzTV.Scanner/ErsatzTV.Scanner.csproj @@ -15,15 +15,15 @@ - + - - + + diff --git a/ErsatzTV/ErsatzTV.csproj b/ErsatzTV/ErsatzTV.csproj index b3620401d..dd5d8e6ce 100644 --- a/ErsatzTV/ErsatzTV.csproj +++ b/ErsatzTV/ErsatzTV.csproj @@ -68,17 +68,17 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + diff --git a/ErsatzTV/Pages/PlayoutAlternateSchedulesEditor.razor b/ErsatzTV/Pages/PlayoutAlternateSchedulesEditor.razor index 7b6ae945d..c00af81ef 100644 --- a/ErsatzTV/Pages/PlayoutAlternateSchedulesEditor.razor +++ b/ErsatzTV/Pages/PlayoutAlternateSchedulesEditor.razor @@ -104,37 +104,37 @@ + CheckedChanged="@((bool c) => DayOfWeekChanged(DayOfWeek.Monday, c))"/> + CheckedChanged="@((bool c) => DayOfWeekChanged(DayOfWeek.Tuesday, c))"/> + CheckedChanged="@((bool c) => DayOfWeekChanged(DayOfWeek.Wednesday, c))"/> + CheckedChanged="@((bool c) => DayOfWeekChanged(DayOfWeek.Thursday, c))"/> + CheckedChanged="@((bool c) => DayOfWeekChanged(DayOfWeek.Friday, c))"/> + CheckedChanged="@((bool c) => DayOfWeekChanged(DayOfWeek.Saturday, c))"/> + CheckedChanged="@((bool c) => DayOfWeekChanged(DayOfWeek.Sunday, c))"/> @@ -162,7 +162,7 @@ + CheckedChanged="@((bool c) => DayOfMonthChanged(day, c))"/> } @@ -183,14 +183,14 @@ + CheckedChanged="@((bool c) => MonthOfYearChanged(1, c))"/> @foreach (int month in Enumerable.Range(2, 11)) { + CheckedChanged="@((bool c) => MonthOfYearChanged(month, c))"/> }