scheduling fixes (#451)

* scheduling fixes

* restore plex service

* restore plex service part 2
This commit is contained in:
Jason Dove
2021-10-24 06:49:35 -05:00
committed by GitHub
parent a2f74dd284
commit a74547997d
7 changed files with 3915 additions and 23 deletions
@@ -0,0 +1,38 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace ErsatzTV.Infrastructure.Migrations
{
public partial class Fix_ProgramScheduleItemMidnightStartTime : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
"update ProgramScheduleItem set StartTime = '00:00:00' where StartTime = '1.00:00:00'");
migrationBuilder.Sql(
@"delete from PlayoutItem where PlayoutId in
(select Playout.Id from Playout
inner join ProgramSchedule PS on Playout.ProgramScheduleId = PS.Id
inner join ProgramScheduleItem PSI on PSI.ProgramScheduleId = PS.Id
where PSI.StartTime = '00:00:00')");
migrationBuilder.Sql(
@"delete from PlayoutProgramScheduleAnchor where PlayoutId in
(select Playout.Id from Playout
inner join ProgramSchedule PS on Playout.ProgramScheduleId = PS.Id
inner join ProgramScheduleItem PSI on PSI.ProgramScheduleId = PS.Id
where PSI.StartTime = '00:00:00')");
migrationBuilder.Sql(
@"UPDATE Playout SET Anchor_NextStart = null, Anchor_NextScheduleItemId = null where Id in
(select Playout.Id from Playout
inner join ProgramSchedule PS on Playout.ProgramScheduleId = PS.Id
inner join ProgramScheduleItem PSI on PSI.ProgramScheduleId = PS.Id
where PSI.StartTime = '00:00:00')");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}