fix overlapping playout items check (#2303)

This commit is contained in:
Jason Dove
2025-08-12 11:35:12 +00:00
committed by GitHub
parent 771bfba01c
commit b149f7f2a3
@@ -15,11 +15,14 @@ public class CheckForOverlappingPlayoutItemsHandler(
bool hasConflict = await dbContext.PlayoutItems
.Where(pi => pi.PlayoutId == request.PlayoutId)
.AnyAsync(a => dbContext.PlayoutItems
.Any(b =>
a.Id < b.Id &&
a.Start < b.Finish &&
a.Finish > b.Start),
.AnyAsync(
a => dbContext.PlayoutItems
.Where(b => b.PlayoutId == a.PlayoutId)
.Any(
b =>
a.Id < b.Id &&
a.Start < b.Finish &&
a.Finish > b.Start),
cancellationToken);
if (hasConflict)