maintain collection progress across alternate schedules (#1211)
This commit is contained in:
@@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Fix playout mode duration bugs in XMLTV
|
||||
- Tail mode filler will properly include filler duration in XMLTV
|
||||
- Duration that wraps across midnight will no longer have overlapping items in XMLTV
|
||||
- Maintain collection progress across all alternate schedules on a playout
|
||||
|
||||
### Changed
|
||||
- Ignore case of video and audio file extensions in local folder scanner
|
||||
|
||||
@@ -2078,8 +2078,7 @@ public class PlayoutBuilderTests
|
||||
Index = 1,
|
||||
Seed = 12345
|
||||
},
|
||||
Playout = playout,
|
||||
ProgramSchedule = playout.ProgramSchedule
|
||||
Playout = playout
|
||||
});
|
||||
|
||||
var configRepo = new Mock<IConfigElementRepository>();
|
||||
@@ -2242,8 +2241,6 @@ public class PlayoutBuilderTests
|
||||
MediaItemId = headAnchor.MediaItemId,
|
||||
MultiCollection = headAnchor.MultiCollection,
|
||||
MultiCollectionId = headAnchor.MultiCollectionId,
|
||||
ProgramSchedule = headAnchor.ProgramSchedule,
|
||||
ProgramScheduleId = headAnchor.ProgramScheduleId,
|
||||
SmartCollection = headAnchor.SmartCollection,
|
||||
SmartCollectionId = headAnchor.SmartCollectionId
|
||||
});
|
||||
|
||||
@@ -10,11 +10,6 @@ public class PlayoutProgramScheduleAnchor
|
||||
[NotLogged]
|
||||
public Playout Playout { get; set; }
|
||||
|
||||
public int ProgramScheduleId { get; set; }
|
||||
|
||||
[NotLogged]
|
||||
public ProgramSchedule ProgramSchedule { get; set; }
|
||||
|
||||
public DateTime? AnchorDate { get; set; }
|
||||
|
||||
public DateTimeOffset? AnchorDateOffset => AnchorDate.HasValue
|
||||
|
||||
@@ -684,8 +684,6 @@ public class PlayoutBuilder : IPlayoutBuilder
|
||||
{
|
||||
Playout = playout,
|
||||
PlayoutId = playout.Id,
|
||||
ProgramSchedule = activeSchedule,
|
||||
ProgramScheduleId = activeSchedule.Id,
|
||||
CollectionType = collectionKey.CollectionType,
|
||||
CollectionId = collectionKey.CollectionId,
|
||||
MultiCollectionId = collectionKey.MultiCollectionId,
|
||||
@@ -722,8 +720,7 @@ public class PlayoutBuilder : IPlayoutBuilder
|
||||
Option<PlayoutProgramScheduleAnchor> maybeAnchor = playout.ProgramScheduleAnchors
|
||||
.OrderByDescending(a => a.AnchorDate ?? DateTime.MaxValue)
|
||||
.FirstOrDefault(
|
||||
a => a.ProgramScheduleId == activeSchedule.Id
|
||||
&& a.CollectionType == collectionKey.CollectionType
|
||||
a => a.CollectionType == collectionKey.CollectionType
|
||||
&& a.CollectionId == collectionKey.CollectionId
|
||||
&& a.MultiCollectionId == collectionKey.MultiCollectionId
|
||||
&& a.SmartCollectionId == collectionKey.SmartCollectionId
|
||||
|
||||
+4416
File diff suppressed because it is too large
Load Diff
+50
@@ -0,0 +1,50 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ErsatzTV.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Remove_PlayoutProgramScheduleAnchor_ProgramScheduleId : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PlayoutProgramScheduleAnchor_ProgramSchedule_ProgramScheduleId",
|
||||
table: "PlayoutProgramScheduleAnchor");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_PlayoutProgramScheduleAnchor_ProgramScheduleId",
|
||||
table: "PlayoutProgramScheduleAnchor");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ProgramScheduleId",
|
||||
table: "PlayoutProgramScheduleAnchor");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "ProgramScheduleId",
|
||||
table: "PlayoutProgramScheduleAnchor",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlayoutProgramScheduleAnchor_ProgramScheduleId",
|
||||
table: "PlayoutProgramScheduleAnchor",
|
||||
column: "ProgramScheduleId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PlayoutProgramScheduleAnchor_ProgramSchedule_ProgramScheduleId",
|
||||
table: "PlayoutProgramScheduleAnchor",
|
||||
column: "ProgramScheduleId",
|
||||
principalTable: "ProgramSchedule",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1515,9 +1515,6 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.Property<int>("PlayoutId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ProgramScheduleId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("SmartCollectionId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
@@ -1531,8 +1528,6 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
|
||||
b.HasIndex("PlayoutId");
|
||||
|
||||
b.HasIndex("ProgramScheduleId");
|
||||
|
||||
b.HasIndex("SmartCollectionId");
|
||||
|
||||
b.ToTable("PlayoutProgramScheduleAnchor", (string)null);
|
||||
@@ -3370,12 +3365,6 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProgramScheduleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.SmartCollection", "SmartCollection")
|
||||
.WithMany()
|
||||
.HasForeignKey("SmartCollectionId")
|
||||
@@ -3410,8 +3399,6 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
|
||||
b.Navigation("Playout");
|
||||
|
||||
b.Navigation("ProgramSchedule");
|
||||
|
||||
b.Navigation("SmartCollection");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user