better trakt lists (#384)
* better trakt list support * update dependencies * revert unneeded brackets
This commit is contained in:
+3283
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,108 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ErsatzTV.Infrastructure.Migrations
|
||||
{
|
||||
public partial class Add_TraktList : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TraktList",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
TraktId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
User = table.Column<string>(type: "TEXT", nullable: true),
|
||||
List = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Description = table.Column<string>(type: "TEXT", nullable: true),
|
||||
ItemCount = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TraktList", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TraktListItem",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
TraktListId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Kind = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
TraktId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Rank = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Title = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Year = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
Season = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
Episode = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
MediaItemId = table.Column<int>(type: "INTEGER", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TraktListItem", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_TraktListItem_MediaItem_MediaItemId",
|
||||
column: x => x.MediaItemId,
|
||||
principalTable: "MediaItem",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_TraktListItem_TraktList_TraktListId",
|
||||
column: x => x.TraktListId,
|
||||
principalTable: "TraktList",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TraktListItemGuid",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Guid = table.Column<string>(type: "TEXT", nullable: true),
|
||||
TraktListItemId = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TraktListItemGuid", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_TraktListItemGuid_TraktListItem_TraktListItemId",
|
||||
column: x => x.TraktListItemId,
|
||||
principalTable: "TraktListItem",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TraktListItem_MediaItemId",
|
||||
table: "TraktListItem",
|
||||
column: "MediaItemId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TraktListItem_TraktListId",
|
||||
table: "TraktListItem",
|
||||
column: "TraktListId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TraktListItemGuid_TraktListItemId",
|
||||
table: "TraktListItemGuid",
|
||||
column: "TraktListItemId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "TraktListItemGuid");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "TraktListItem");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "TraktList");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1507,6 +1507,96 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.ToTable("Tag");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.TraktList", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("ItemCount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("List")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("TraktId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("User")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TraktList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.TraktListItem", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("Episode")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Kind")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("MediaItemId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Rank")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("Season")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("TraktId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("TraktListId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("Year")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MediaItemId");
|
||||
|
||||
b.HasIndex("TraktListId");
|
||||
|
||||
b.ToTable("TraktListItem");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.TraktListItemGuid", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Guid")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("TraktListItemId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TraktListItemId");
|
||||
|
||||
b.ToTable("TraktListItemGuid");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Writer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -2596,6 +2686,34 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.TraktListItem", b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.MediaItem", "MediaItem")
|
||||
.WithMany("TraktListItems")
|
||||
.HasForeignKey("MediaItemId");
|
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.TraktList", "TraktList")
|
||||
.WithMany("Items")
|
||||
.HasForeignKey("TraktListId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("MediaItem");
|
||||
|
||||
b.Navigation("TraktList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.TraktListItemGuid", b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.TraktListItem", "TraktListItem")
|
||||
.WithMany("Guids")
|
||||
.HasForeignKey("TraktListItemId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("TraktListItem");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Writer", b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
|
||||
@@ -2979,6 +3097,8 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b =>
|
||||
{
|
||||
b.Navigation("CollectionItems");
|
||||
|
||||
b.Navigation("TraktListItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaSource", b =>
|
||||
@@ -3083,6 +3203,16 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.Navigation("MultiCollectionSmartItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.TraktList", b =>
|
||||
{
|
||||
b.Navigation("Items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.TraktListItem", b =>
|
||||
{
|
||||
b.Navigation("Guids");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Artist", b =>
|
||||
{
|
||||
b.Navigation("ArtistMetadata");
|
||||
|
||||
Reference in New Issue
Block a user