mirror of https://github.com/ErsatzTV/ErsatzTV.git
20 changed files with 3519 additions and 29 deletions
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
using ErsatzTV.Core.Domain; |
||||
|
||||
namespace ErsatzTV.Application.MediaCollections |
||||
{ |
||||
public record MultiCollectionSmartItemViewModel( |
||||
int MultiCollectionId, |
||||
SmartCollectionViewModel SmartCollection, |
||||
bool ScheduleAsGroup, |
||||
PlaybackOrder PlaybackOrder); |
||||
} |
||||
@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
|
||||
namespace ErsatzTV.Core.Domain |
||||
{ |
||||
public class MultiCollectionSmartItem |
||||
{ |
||||
public int MultiCollectionId { get; set; } |
||||
public MultiCollection MultiCollection { get; set; } |
||||
public int SmartCollectionId { get; set; } |
||||
public SmartCollection SmartCollection { get; set; } |
||||
public bool ScheduleAsGroup { get; set; } |
||||
public PlaybackOrder PlaybackOrder { get; set; } |
||||
} |
||||
} |
||||
@ -1,9 +1,13 @@
@@ -1,9 +1,13 @@
|
||||
namespace ErsatzTV.Core.Domain |
||||
using System.Collections.Generic; |
||||
|
||||
namespace ErsatzTV.Core.Domain |
||||
{ |
||||
public class SmartCollection |
||||
{ |
||||
public int Id { get; set; } |
||||
public string Name { get; set; } |
||||
public string Query { get; set; } |
||||
public List<MultiCollection> MultiCollections { get; set; } |
||||
public List<MultiCollectionSmartItem> MultiCollectionSmartItems { get; set; } |
||||
} |
||||
} |
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,47 @@
@@ -0,0 +1,47 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Migrations |
||||
{ |
||||
public partial class Add_MultiCollectionSmartCollection : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.CreateTable( |
||||
name: "MultiCollectionSmartItem", |
||||
columns: table => new |
||||
{ |
||||
MultiCollectionId = table.Column<int>(type: "INTEGER", nullable: false), |
||||
SmartCollectionId = table.Column<int>(type: "INTEGER", nullable: false), |
||||
ScheduleAsGroup = table.Column<bool>(type: "INTEGER", nullable: false), |
||||
PlaybackOrder = table.Column<int>(type: "INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_MultiCollectionSmartItem", x => new { x.MultiCollectionId, x.SmartCollectionId }); |
||||
table.ForeignKey( |
||||
name: "FK_MultiCollectionSmartItem_MultiCollection_MultiCollectionId", |
||||
column: x => x.MultiCollectionId, |
||||
principalTable: "MultiCollection", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
name: "FK_MultiCollectionSmartItem_SmartCollection_SmartCollectionId", |
||||
column: x => x.SmartCollectionId, |
||||
principalTable: "SmartCollection", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
name: "IX_MultiCollectionSmartItem_SmartCollectionId", |
||||
table: "MultiCollectionSmartItem", |
||||
column: "SmartCollectionId"); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropTable( |
||||
name: "MultiCollectionSmartItem"); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
using ErsatzTV.Application.MediaCollections; |
||||
|
||||
namespace ErsatzTV.ViewModels |
||||
{ |
||||
public class MultiCollectionSmartItemEditViewModel : MultiCollectionItemEditViewModel |
||||
{ |
||||
private SmartCollectionViewModel _smartCollection; |
||||
|
||||
public SmartCollectionViewModel SmartCollection |
||||
{ |
||||
get => _smartCollection; |
||||
set |
||||
{ |
||||
_smartCollection = value; |
||||
|
||||
Collection = new MediaCollectionViewModel( |
||||
_smartCollection.Id, |
||||
_smartCollection.Name, |
||||
false); |
||||
} |
||||
} |
||||
|
||||
public override MediaCollectionViewModel Collection { get; set; } |
||||
} |
||||
} |
||||
Loading…
Reference in new issue