add global and channel fallback filler (#459)

* configure channel and global fallback filler

* play random item from configured channel/global fallback filler as needed
This commit is contained in:
Jason Dove
2021-10-30 11:45:40 -05:00
committed by GitHub
parent 2ea0e64ac1
commit 0136de700c
24 changed files with 4127 additions and 49 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,68 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace ErsatzTV.Infrastructure.Migrations
{
public partial class Add_ChannelFallbackFiller : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Channel_ChannelWatermark_WatermarkId",
table: "Channel");
migrationBuilder.AddColumn<int>(
name: "FallbackFillerId",
table: "Channel",
type: "INTEGER",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Channel_FallbackFillerId",
table: "Channel",
column: "FallbackFillerId");
migrationBuilder.AddForeignKey(
name: "FK_Channel_ChannelWatermark_WatermarkId",
table: "Channel",
column: "WatermarkId",
principalTable: "ChannelWatermark",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey(
name: "FK_Channel_FillerPreset_FallbackFillerId",
table: "Channel",
column: "FallbackFillerId",
principalTable: "FillerPreset",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Channel_ChannelWatermark_WatermarkId",
table: "Channel");
migrationBuilder.DropForeignKey(
name: "FK_Channel_FillerPreset_FallbackFillerId",
table: "Channel");
migrationBuilder.DropIndex(
name: "IX_Channel_FallbackFillerId",
table: "Channel");
migrationBuilder.DropColumn(
name: "FallbackFillerId",
table: "Channel");
migrationBuilder.AddForeignKey(
name: "FK_Channel_ChannelWatermark_WatermarkId",
table: "Channel",
column: "WatermarkId",
principalTable: "ChannelWatermark",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}
}
@@ -198,6 +198,9 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Property<int>("FFmpegProfileId")
.HasColumnType("INTEGER");
b.Property<int?>("FallbackFillerId")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.HasColumnType("TEXT");
@@ -220,6 +223,8 @@ namespace ErsatzTV.Infrastructure.Migrations
b.HasIndex("FFmpegProfileId");
b.HasIndex("FallbackFillerId");
b.HasIndex("Number")
.IsUnique();
@@ -2293,9 +2298,17 @@ namespace ErsatzTV.Infrastructure.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("ErsatzTV.Core.Domain.Filler.FillerPreset", "FallbackFiller")
.WithMany()
.HasForeignKey("FallbackFillerId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("ErsatzTV.Core.Domain.ChannelWatermark", "Watermark")
.WithMany()
.HasForeignKey("WatermarkId");
.HasForeignKey("WatermarkId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("FallbackFiller");
b.Navigation("FFmpegProfile");