Files
ersatztv/ErsatzTV.Infrastructure/Migrations/20211019173552_Migrate_TailFiller_FillerPreset.cs
T
Jason DoveandGitHub 6d147de2f3 filler rework (#449)
* add chapter statistics and new filler options

* refactor playout builder

* more refactor prep for filler

* rewrite schedulers

* refactor collectionkey

* add tail filler kind

* migrate tail filler to filler preset

* optionally show filler

* fix playout detail row count

* remove duration tail filler options

* implement tail and fallback in flood scheduler

* implement tail and fallback in one scheduler

* implement tail and fallback in multiple scheduler

* implement looping fallback filler

* more duration tests

* start to add post-roll filler to flood

* rework playoutitem filler tagging

* rework scheduler logging

* calculate whether configured filler will fit

* implement pre-roll and post-roll duration and count filler

* improve duration filler calculation

* add minutes to search index

* update channel guide to work with new filler

* add mid-roll filler

* don't clone enumerators for filler calculations

* support pre-roll and post-roll pad filler

* implement mid-roll pad filler

* allow clearing filler selections in schedule editor

* fix tests

* filler config validation

* use consistent time zone for tests
2021-10-21 20:23:14 -05:00

36 lines
1.5 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
namespace ErsatzTV.Infrastructure.Migrations
{
public partial class Migrate_TailFiller_FillerPreset : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
@"
insert into FillerPreset (Name, FillerKind, FillerMode, CollectionType, MediaItemId, CollectionId, MultiCollectionId, SmartCollectionId)
select
'Migrated_Filler_' || TailCollectionType || '_' || ifnull(TailCollectionId, '') || '_' || ifnull(TailMediaItemId, '') || '_' || ifnull(TailMultiCollectionId, '') || '_' || ifnull(TailSmartCollectionId, ''),
4,
0,
TailCollectionType,
TailMediaItemId,
TailCollectionId,
TailMultiCollectionId,
TailSmartCollectionId
from (select distinct TailCollectionType, TailCollectionId, TailMediaItemId, TailMultiCollectionId, TailSmartCollectionId from ProgramScheduleDurationItem)");
migrationBuilder.Sql(
@"
update ProgramScheduleItem
set TailFillerId = FPID
from (select fp.Id as FPID, psdi.Id as PSDIID from FillerPreset fp inner join ProgramScheduleDurationItem psdi where TailCollectionType = CollectionType and TailCollectionId is CollectionId and TailMediaItemId is MediaItemId and TailMultiCollectionId is MultiCollectionId and TailSmartCollectionId is SmartCollectionId) as whatever
where PSDIID = ProgramScheduleItem.Id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}