diff --git a/src/BUTR.Site.NexusMods.Client/Pages/Administration/QuartzManager.razor b/src/BUTR.Site.NexusMods.Client/Pages/Administration/QuartzManager.razor index faf20221..23828899 100644 --- a/src/BUTR.Site.NexusMods.Client/Pages/Administration/QuartzManager.razor +++ b/src/BUTR.Site.NexusMods.Client/Pages/Administration/QuartzManager.razor @@ -60,7 +60,7 @@ - @(context.ScheduleFireTimeUtc?.ToString("yyyy-MM-dd HH:mm:ss")) + @(context.ScheduleFireTimeUtc?.ToString("yyyy-MM-dd HH:mm:ss") ?? string.Empty) @(context.FireTimeUtc.ToString("yyyy-MM-dd HH:mm:ss")) diff --git a/src/BUTR.Site.NexusMods.Server/Contexts/Configs/CrashReportIgnoredFileIdEntityConfiguration.cs b/src/BUTR.Site.NexusMods.Server/Contexts/Configs/CrashReportIgnoredFileIdEntityConfiguration.cs index 5dba9087..b6478e06 100644 --- a/src/BUTR.Site.NexusMods.Server/Contexts/Configs/CrashReportIgnoredFileIdEntityConfiguration.cs +++ b/src/BUTR.Site.NexusMods.Server/Contexts/Configs/CrashReportIgnoredFileIdEntityConfiguration.cs @@ -1,4 +1,3 @@ -using BUTR.Site.NexusMods.Server.Models; using BUTR.Site.NexusMods.Server.Models.Database; using Microsoft.EntityFrameworkCore; @@ -12,9 +11,8 @@ public CrashReportIgnoredFileIdEntityConfiguration(ITenantContextAccessor tenant protected override void ConfigureModel(EntityTypeBuilder builder) { - builder.Property(x => x.CrashReportIgnoredFileId).HasColumnName("crash_report_file_ignored_id").ValueGeneratedOnAdd(); - builder.Property(x => x.Value).HasColumnName("value").HasVogenConversion(); - builder.ToTable("crash_report_file_ignored", "crashreport").HasKey(x => x.CrashReportIgnoredFileId); + builder.Property(x => x.CrashReportFileId).HasColumnName("crash_report_file_ignored_id").ValueGeneratedOnAdd(); + builder.ToTable("crash_report_file_ignored", "crashreport").HasKey(x => new { x.TenantId, Value = x.CrashReportFileId }); base.ConfigureModel(builder); } diff --git a/src/BUTR.Site.NexusMods.Server/Models/Database/CrashReportIgnoredFileEntity.cs b/src/BUTR.Site.NexusMods.Server/Models/Database/CrashReportIgnoredFileEntity.cs index 4b8146b6..3cb798c9 100644 --- a/src/BUTR.Site.NexusMods.Server/Models/Database/CrashReportIgnoredFileEntity.cs +++ b/src/BUTR.Site.NexusMods.Server/Models/Database/CrashReportIgnoredFileEntity.cs @@ -6,9 +6,7 @@ public sealed record CrashReportIgnoredFileEntity : IEntityWithTenant { public required TenantId TenantId { get; init; } - public required int CrashReportIgnoredFileId { get; init; } + public required CrashReportFileId CrashReportFileId { get; init; } - public required CrashReportFileId Value { get; init; } - - public override int GetHashCode() => HashCode.Combine(TenantId, CrashReportIgnoredFileId, Value); + public override int GetHashCode() => HashCode.Combine(TenantId, CrashReportFileId); } \ No newline at end of file diff --git a/src/BUTR.Site.NexusMods.Server/Services/General/ICrashReportBatchedHandler.cs b/src/BUTR.Site.NexusMods.Server/Services/General/ICrashReportBatchedHandler.cs index a3f2ace3..1d3bac02 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/General/ICrashReportBatchedHandler.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/General/ICrashReportBatchedHandler.cs @@ -134,9 +134,8 @@ await _linkedCrashReportsChannel.Writer.WriteAsync(new CrashReportToFileIdEntity await _ignoredCrashReportsChannel.Writer.WaitToWriteAsync(ct); await _ignoredCrashReportsChannel.Writer.WriteAsync(new CrashReportIgnoredFileEntity { - CrashReportIgnoredFileId = default, TenantId = tenant, - Value = duplicateLink.FileId + CrashReportFileId = duplicateLink.FileId }, ct); } @@ -238,9 +237,8 @@ private async Task WriteCrashReportsToDatabaseAsync(CancellationToken ct) { ignoredCrashReportFileEntities.Add(new CrashReportIgnoredFileEntity { - CrashReportIgnoredFileId = default, TenantId = tenant, - Value = fileId + CrashReportFileId = fileId }); continue; } @@ -295,9 +293,8 @@ private async Task WriteCrashReportsToDatabaseAsync(CancellationToken ct) .Concat(ignoredCrashReportFileEntities.ToAsyncEnumerable()) .Concat(failedCrashReportFileIds.Select(x => new CrashReportIgnoredFileEntity { - CrashReportIgnoredFileId = default, TenantId = tenant, - Value = x, + CrashReportFileId = x, }).ToAsyncEnumerable()); unitOfWrite.CrashReports.UpsertRange(crashReportsBuilder);