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
|
- Fix playout mode duration bugs in XMLTV
|
||||||
- Tail mode filler will properly include filler duration 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
|
- Duration that wraps across midnight will no longer have overlapping items in XMLTV
|
||||||
|
- Maintain collection progress across all alternate schedules on a playout
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Ignore case of video and audio file extensions in local folder scanner
|
- Ignore case of video and audio file extensions in local folder scanner
|
||||||
|
|||||||
@@ -2078,8 +2078,7 @@ public class PlayoutBuilderTests
|
|||||||
Index = 1,
|
Index = 1,
|
||||||
Seed = 12345
|
Seed = 12345
|
||||||
},
|
},
|
||||||
Playout = playout,
|
Playout = playout
|
||||||
ProgramSchedule = playout.ProgramSchedule
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var configRepo = new Mock<IConfigElementRepository>();
|
var configRepo = new Mock<IConfigElementRepository>();
|
||||||
@@ -2242,8 +2241,6 @@ public class PlayoutBuilderTests
|
|||||||
MediaItemId = headAnchor.MediaItemId,
|
MediaItemId = headAnchor.MediaItemId,
|
||||||
MultiCollection = headAnchor.MultiCollection,
|
MultiCollection = headAnchor.MultiCollection,
|
||||||
MultiCollectionId = headAnchor.MultiCollectionId,
|
MultiCollectionId = headAnchor.MultiCollectionId,
|
||||||
ProgramSchedule = headAnchor.ProgramSchedule,
|
|
||||||
ProgramScheduleId = headAnchor.ProgramScheduleId,
|
|
||||||
SmartCollection = headAnchor.SmartCollection,
|
SmartCollection = headAnchor.SmartCollection,
|
||||||
SmartCollectionId = headAnchor.SmartCollectionId
|
SmartCollectionId = headAnchor.SmartCollectionId
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,11 +10,6 @@ public class PlayoutProgramScheduleAnchor
|
|||||||
[NotLogged]
|
[NotLogged]
|
||||||
public Playout Playout { get; set; }
|
public Playout Playout { get; set; }
|
||||||
|
|
||||||
public int ProgramScheduleId { get; set; }
|
|
||||||
|
|
||||||
[NotLogged]
|
|
||||||
public ProgramSchedule ProgramSchedule { get; set; }
|
|
||||||
|
|
||||||
public DateTime? AnchorDate { get; set; }
|
public DateTime? AnchorDate { get; set; }
|
||||||
|
|
||||||
public DateTimeOffset? AnchorDateOffset => AnchorDate.HasValue
|
public DateTimeOffset? AnchorDateOffset => AnchorDate.HasValue
|
||||||
|
|||||||
@@ -684,8 +684,6 @@ public class PlayoutBuilder : IPlayoutBuilder
|
|||||||
{
|
{
|
||||||
Playout = playout,
|
Playout = playout,
|
||||||
PlayoutId = playout.Id,
|
PlayoutId = playout.Id,
|
||||||
ProgramSchedule = activeSchedule,
|
|
||||||
ProgramScheduleId = activeSchedule.Id,
|
|
||||||
CollectionType = collectionKey.CollectionType,
|
CollectionType = collectionKey.CollectionType,
|
||||||
CollectionId = collectionKey.CollectionId,
|
CollectionId = collectionKey.CollectionId,
|
||||||
MultiCollectionId = collectionKey.MultiCollectionId,
|
MultiCollectionId = collectionKey.MultiCollectionId,
|
||||||
@@ -722,8 +720,7 @@ public class PlayoutBuilder : IPlayoutBuilder
|
|||||||
Option<PlayoutProgramScheduleAnchor> maybeAnchor = playout.ProgramScheduleAnchors
|
Option<PlayoutProgramScheduleAnchor> maybeAnchor = playout.ProgramScheduleAnchors
|
||||||
.OrderByDescending(a => a.AnchorDate ?? DateTime.MaxValue)
|
.OrderByDescending(a => a.AnchorDate ?? DateTime.MaxValue)
|
||||||
.FirstOrDefault(
|
.FirstOrDefault(
|
||||||
a => a.ProgramScheduleId == activeSchedule.Id
|
a => a.CollectionType == collectionKey.CollectionType
|
||||||
&& a.CollectionType == collectionKey.CollectionType
|
|
||||||
&& a.CollectionId == collectionKey.CollectionId
|
&& a.CollectionId == collectionKey.CollectionId
|
||||||
&& a.MultiCollectionId == collectionKey.MultiCollectionId
|
&& a.MultiCollectionId == collectionKey.MultiCollectionId
|
||||||
&& a.SmartCollectionId == collectionKey.SmartCollectionId
|
&& 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")
|
b.Property<int>("PlayoutId")
|
||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
b.Property<int>("ProgramScheduleId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<int?>("SmartCollectionId")
|
b.Property<int?>("SmartCollectionId")
|
||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
@@ -1531,8 +1528,6 @@ namespace ErsatzTV.Infrastructure.Migrations
|
|||||||
|
|
||||||
b.HasIndex("PlayoutId");
|
b.HasIndex("PlayoutId");
|
||||||
|
|
||||||
b.HasIndex("ProgramScheduleId");
|
|
||||||
|
|
||||||
b.HasIndex("SmartCollectionId");
|
b.HasIndex("SmartCollectionId");
|
||||||
|
|
||||||
b.ToTable("PlayoutProgramScheduleAnchor", (string)null);
|
b.ToTable("PlayoutProgramScheduleAnchor", (string)null);
|
||||||
@@ -3370,12 +3365,6 @@ namespace ErsatzTV.Infrastructure.Migrations
|
|||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ProgramScheduleId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("ErsatzTV.Core.Domain.SmartCollection", "SmartCollection")
|
b.HasOne("ErsatzTV.Core.Domain.SmartCollection", "SmartCollection")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("SmartCollectionId")
|
.HasForeignKey("SmartCollectionId")
|
||||||
@@ -3410,8 +3399,6 @@ namespace ErsatzTV.Infrastructure.Migrations
|
|||||||
|
|
||||||
b.Navigation("Playout");
|
b.Navigation("Playout");
|
||||||
|
|
||||||
b.Navigation("ProgramSchedule");
|
|
||||||
|
|
||||||
b.Navigation("SmartCollection");
|
b.Navigation("SmartCollection");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user