Browse Source

fix overlapping playout items check (#2303)

pull/2304/head
Jason Dove 5 days ago committed by GitHub
parent
commit
b149f7f2a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      ErsatzTV.Application/Playouts/Queries/CheckForOverlappingPlayoutItemsHandler.cs

7
ErsatzTV.Application/Playouts/Queries/CheckForOverlappingPlayoutItemsHandler.cs

@ -15,8 +15,11 @@ public class CheckForOverlappingPlayoutItemsHandler( @@ -15,8 +15,11 @@ public class CheckForOverlappingPlayoutItemsHandler(
bool hasConflict = await dbContext.PlayoutItems
.Where(pi => pi.PlayoutId == request.PlayoutId)
.AnyAsync(a => dbContext.PlayoutItems
.Any(b =>
.AnyAsync(
a => dbContext.PlayoutItems
.Where(b => b.PlayoutId == a.PlayoutId)
.Any(
b =>
a.Id < b.Id &&
a.Start < b.Finish &&
a.Finish > b.Start),

Loading…
Cancel
Save