add artists as owners of music videos (#154)
* clean up genre, tag, studio orphans * enforce foreign keys at connection level * wip * fix fragment scroll offset * fix see all link for music videos * add fake artist metadata * not null artist id * add artist scanning * remove improperly named music videos * code cleanup * add artists to search results and collections * clean up music video metadata / artist * add artist view * show music videos on artist page * add music video artwork placeholder
This commit is contained in:
Generated
+1964
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ErsatzTV.Infrastructure.Migrations
|
||||
{
|
||||
public partial class Delete_Orphan_GenreTagStudio : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql(
|
||||
@"DELETE FROM Genre
|
||||
WHERE MovieMetadataId NOT IN (SELECT Id FROM MovieMetadata)
|
||||
OR ShowMetadataId NOT IN (SELECT Id FROM Show)
|
||||
OR SeasonMetadataId NOT IN (SELECT Id FROM Season)
|
||||
OR EpisodeMetadataId NOT IN (SELECT Id FROM Episode)
|
||||
OR MusicVideoMetadataId NOT IN (SELECT Id FROM MusicVideoMetadata)");
|
||||
|
||||
migrationBuilder.Sql(
|
||||
@"DELETE FROM Tag
|
||||
WHERE MovieMetadataId NOT IN (SELECT Id FROM MovieMetadata)
|
||||
OR ShowMetadataId NOT IN (SELECT Id FROM Show)
|
||||
OR SeasonMetadataId NOT IN (SELECT Id FROM Season)
|
||||
OR EpisodeMetadataId NOT IN (SELECT Id FROM Episode)
|
||||
OR MusicVideoMetadataId NOT IN (SELECT Id FROM MusicVideoMetadata)");
|
||||
|
||||
migrationBuilder.Sql(
|
||||
@"DELETE FROM Studio
|
||||
WHERE MovieMetadataId NOT IN (SELECT Id FROM MovieMetadata)
|
||||
OR ShowMetadataId NOT IN (SELECT Id FROM Show)
|
||||
OR SeasonMetadataId NOT IN (SELECT Id FROM Season)
|
||||
OR EpisodeMetadataId NOT IN (SELECT Id FROM Episode)
|
||||
OR MusicVideoMetadataId NOT IN (SELECT Id FROM MusicVideoMetadata)");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,284 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ErsatzTV.Infrastructure.Migrations
|
||||
{
|
||||
public partial class Add_Artist : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
"ArtistMetadataId",
|
||||
"Tag",
|
||||
"INTEGER",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
"ArtistMetadataId",
|
||||
"Studio",
|
||||
"INTEGER",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
"ArtistId",
|
||||
"MusicVideo",
|
||||
"INTEGER",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
"ArtistMetadataId",
|
||||
"Genre",
|
||||
"INTEGER",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
"ArtistMetadataId",
|
||||
"Artwork",
|
||||
"INTEGER",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
"Artist",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>("INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Artist", x => x.Id);
|
||||
table.ForeignKey(
|
||||
"FK_Artist_MediaItem_Id",
|
||||
x => x.Id,
|
||||
"MediaItem",
|
||||
"Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
"ArtistMetadata",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>("INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Disambiguation = table.Column<string>("TEXT", nullable: true),
|
||||
Biography = table.Column<string>("TEXT", nullable: true),
|
||||
Formed = table.Column<string>("TEXT", nullable: true),
|
||||
ArtistId = table.Column<int>("INTEGER", nullable: true),
|
||||
MetadataKind = table.Column<int>("INTEGER", nullable: false),
|
||||
Title = table.Column<string>("TEXT", nullable: true),
|
||||
OriginalTitle = table.Column<string>("TEXT", nullable: true),
|
||||
SortTitle = table.Column<string>("TEXT", nullable: true),
|
||||
Year = table.Column<int>("INTEGER", nullable: true),
|
||||
ReleaseDate = table.Column<DateTime>("TEXT", nullable: true),
|
||||
DateAdded = table.Column<DateTime>("TEXT", nullable: false),
|
||||
DateUpdated = table.Column<DateTime>("TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ArtistMetadata", x => x.Id);
|
||||
table.ForeignKey(
|
||||
"FK_ArtistMetadata_Artist_ArtistId",
|
||||
x => x.ArtistId,
|
||||
"Artist",
|
||||
"Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
"Mood",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>("INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>("TEXT", nullable: true),
|
||||
ArtistMetadataId = table.Column<int>("INTEGER", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Mood", x => x.Id);
|
||||
table.ForeignKey(
|
||||
"FK_Mood_ArtistMetadata_ArtistMetadataId",
|
||||
x => x.ArtistMetadataId,
|
||||
"ArtistMetadata",
|
||||
"Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
"Style",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>("INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>("TEXT", nullable: true),
|
||||
ArtistMetadataId = table.Column<int>("INTEGER", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Style", x => x.Id);
|
||||
table.ForeignKey(
|
||||
"FK_Style_ArtistMetadata_ArtistMetadataId",
|
||||
x => x.ArtistMetadataId,
|
||||
"ArtistMetadata",
|
||||
"Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
"IX_Tag_ArtistMetadataId",
|
||||
"Tag",
|
||||
"ArtistMetadataId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
"IX_Studio_ArtistMetadataId",
|
||||
"Studio",
|
||||
"ArtistMetadataId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
"IX_MusicVideo_ArtistId",
|
||||
"MusicVideo",
|
||||
"ArtistId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
"IX_Genre_ArtistMetadataId",
|
||||
"Genre",
|
||||
"ArtistMetadataId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
"IX_Artwork_ArtistMetadataId",
|
||||
"Artwork",
|
||||
"ArtistMetadataId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
"IX_ArtistMetadata_ArtistId",
|
||||
"ArtistMetadata",
|
||||
"ArtistId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
"IX_Mood_ArtistMetadataId",
|
||||
"Mood",
|
||||
"ArtistMetadataId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
"IX_Style_ArtistMetadataId",
|
||||
"Style",
|
||||
"ArtistMetadataId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
"FK_Artwork_ArtistMetadata_ArtistMetadataId",
|
||||
"Artwork",
|
||||
"ArtistMetadataId",
|
||||
"ArtistMetadata",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
"FK_Genre_ArtistMetadata_ArtistMetadataId",
|
||||
"Genre",
|
||||
"ArtistMetadataId",
|
||||
"ArtistMetadata",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
"FK_MusicVideo_Artist_ArtistId",
|
||||
"MusicVideo",
|
||||
"ArtistId",
|
||||
"Artist",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
"FK_Studio_ArtistMetadata_ArtistMetadataId",
|
||||
"Studio",
|
||||
"ArtistMetadataId",
|
||||
"ArtistMetadata",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
"FK_Tag_ArtistMetadata_ArtistMetadataId",
|
||||
"Tag",
|
||||
"ArtistMetadataId",
|
||||
"ArtistMetadata",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
"FK_Artwork_ArtistMetadata_ArtistMetadataId",
|
||||
"Artwork");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
"FK_Genre_ArtistMetadata_ArtistMetadataId",
|
||||
"Genre");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
"FK_MusicVideo_Artist_ArtistId",
|
||||
"MusicVideo");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
"FK_Studio_ArtistMetadata_ArtistMetadataId",
|
||||
"Studio");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
"FK_Tag_ArtistMetadata_ArtistMetadataId",
|
||||
"Tag");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
"Mood");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
"Style");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
"ArtistMetadata");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
"Artist");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
"IX_Tag_ArtistMetadataId",
|
||||
"Tag");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
"IX_Studio_ArtistMetadataId",
|
||||
"Studio");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
"IX_MusicVideo_ArtistId",
|
||||
"MusicVideo");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
"IX_Genre_ArtistMetadataId",
|
||||
"Genre");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
"IX_Artwork_ArtistMetadataId",
|
||||
"Artwork");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
"ArtistMetadataId",
|
||||
"Tag");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
"ArtistMetadataId",
|
||||
"Studio");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
"ArtistId",
|
||||
"MusicVideo");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
"ArtistMetadataId",
|
||||
"Genre");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
"ArtistMetadataId",
|
||||
"Artwork");
|
||||
}
|
||||
}
|
||||
}
|
||||
+2165
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ErsatzTV.Infrastructure.Migrations
|
||||
{
|
||||
public partial class Add_ArtistMetadata : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
var now = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.FFFFFFF");
|
||||
|
||||
migrationBuilder.Sql(
|
||||
@"INSERT INTO MediaItem (LibraryPathId)
|
||||
SELECT LibraryPath.Id FROM LibraryPath INNER JOIN Library L on LibraryPath.LibraryId = L.Id
|
||||
WHERE MediaKind = 3");
|
||||
|
||||
migrationBuilder.Sql(
|
||||
@"INSERT INTO Artist (Id)
|
||||
SELECT MediaItem.Id FROM MediaItem
|
||||
INNER JOIN LibraryPath LP on MediaItem.LibraryPathId = LP.Id
|
||||
INNER JOIN Library L on LP.LibraryId = L.Id
|
||||
WHERE MediaKind = 3 AND NOT EXISTS (SELECT Id FROM MusicVideo WHERE Id = MediaItem.Id)");
|
||||
|
||||
migrationBuilder.Sql(
|
||||
$@"INSERT INTO ArtistMetadata (ArtistId, Title, DateAdded, DateUpdated, MetadataKind)
|
||||
SELECT Id, '[FAKE ARTIST]', '{now}', '{now}', 0 FROM Artist");
|
||||
|
||||
migrationBuilder.Sql(
|
||||
@"UPDATE MusicVideo SET ArtistId =
|
||||
(SELECT Artist.Id FROM Artist
|
||||
INNER JOIN MediaItem MIA on Artist.Id = MIA.Id
|
||||
INNER JOIN MediaItem MIMV on MusicVideo.Id = MIMV.Id
|
||||
INNER JOIN LibraryPath LPA on MIA.LibraryPathId = LPA.Id
|
||||
INNER JOIN LibraryPath LPMV on MIMV.LibraryPathId = LPMV.Id
|
||||
WHERE LPA.LibraryId = LPMV.LibraryId)");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+2167
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,47 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ErsatzTV.Infrastructure.Migrations
|
||||
{
|
||||
public partial class Update_ArtistMetadata_FK : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
"ArtistId",
|
||||
"MusicVideo",
|
||||
"INTEGER",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "INTEGER",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
"ArtistId",
|
||||
"ArtistMetadata",
|
||||
"INTEGER",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "INTEGER",
|
||||
oldNullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
"ArtistId",
|
||||
"MusicVideo",
|
||||
"INTEGER",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "INTEGER");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
"ArtistId",
|
||||
"ArtistMetadata",
|
||||
"INTEGER",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "INTEGER");
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+2164
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,19 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ErsatzTV.Infrastructure.Migrations
|
||||
{
|
||||
public partial class Delete_MusicVideoMetadata_Artist : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder) =>
|
||||
migrationBuilder.DropColumn(
|
||||
"Artist",
|
||||
"MusicVideoMetadata");
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) =>
|
||||
migrationBuilder.AddColumn<string>(
|
||||
"Artist",
|
||||
"MusicVideoMetadata",
|
||||
"TEXT",
|
||||
nullable: true);
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,57 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "5.0.4");
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.ArtistMetadata",
|
||||
b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ArtistId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Biography")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("DateAdded")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("DateUpdated")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Disambiguation")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Formed")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("MetadataKind")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("OriginalTitle")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime?>("ReleaseDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("SortTitle")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("Year")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ArtistId");
|
||||
|
||||
b.ToTable("ArtistMetadata");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Artwork",
|
||||
b =>
|
||||
@@ -24,6 +75,9 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("ArtistMetadataId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ArtworkKind")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
@@ -56,6 +110,8 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ArtistMetadataId");
|
||||
|
||||
b.HasIndex("ChannelId");
|
||||
|
||||
b.HasIndex("EpisodeMetadataId");
|
||||
@@ -293,6 +349,9 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("ArtistMetadataId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("EpisodeMetadataId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
@@ -313,6 +372,8 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ArtistMetadataId");
|
||||
|
||||
b.HasIndex("EpisodeMetadataId");
|
||||
|
||||
b.HasIndex("MovieMetadataId");
|
||||
@@ -532,6 +593,27 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.ToTable("MediaVersion");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Mood",
|
||||
b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("ArtistMetadataId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ArtistMetadataId");
|
||||
|
||||
b.ToTable("Mood");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.MovieMetadata",
|
||||
b =>
|
||||
@@ -594,9 +676,6 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.Property<string>("Album")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Artist")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("DateAdded")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
@@ -967,6 +1046,9 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("ArtistMetadataId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("EpisodeMetadataId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
@@ -987,6 +1069,8 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ArtistMetadataId");
|
||||
|
||||
b.HasIndex("EpisodeMetadataId");
|
||||
|
||||
b.HasIndex("MovieMetadataId");
|
||||
@@ -1000,6 +1084,27 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.ToTable("Studio");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Style",
|
||||
b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("ArtistMetadataId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ArtistMetadataId");
|
||||
|
||||
b.ToTable("Style");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Tag",
|
||||
b =>
|
||||
@@ -1008,6 +1113,9 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("ArtistMetadataId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("EpisodeMetadataId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
@@ -1028,6 +1136,8 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ArtistMetadataId");
|
||||
|
||||
b.HasIndex("EpisodeMetadataId");
|
||||
|
||||
b.HasIndex("MovieMetadataId");
|
||||
@@ -1080,6 +1190,15 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.ToTable("PlexMediaFile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Artist",
|
||||
b =>
|
||||
{
|
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");
|
||||
|
||||
b.ToTable("Artist");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Episode",
|
||||
b =>
|
||||
@@ -1112,6 +1231,11 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
{
|
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");
|
||||
|
||||
b.Property<int>("ArtistId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasIndex("ArtistId");
|
||||
|
||||
b.ToTable("MusicVideo");
|
||||
});
|
||||
|
||||
@@ -1267,10 +1391,28 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.ToTable("PlexShow");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.ArtistMetadata",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.Artist", "Artist")
|
||||
.WithMany("ArtistMetadata")
|
||||
.HasForeignKey("ArtistId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Artist");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Artwork",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
|
||||
.WithMany("Artwork")
|
||||
.HasForeignKey("ArtistMetadataId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.Channel", null)
|
||||
.WithMany("Artwork")
|
||||
.HasForeignKey("ChannelId")
|
||||
@@ -1366,6 +1508,11 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
"ErsatzTV.Core.Domain.Genre",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
|
||||
.WithMany("Genres")
|
||||
.HasForeignKey("ArtistMetadataId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
|
||||
.WithMany("Genres")
|
||||
.HasForeignKey("EpisodeMetadataId");
|
||||
@@ -1475,6 +1622,16 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Mood",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
|
||||
.WithMany("Moods")
|
||||
.HasForeignKey("ArtistMetadataId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.MovieMetadata",
|
||||
b =>
|
||||
@@ -1725,6 +1882,10 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
"ErsatzTV.Core.Domain.Studio",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
|
||||
.WithMany("Studios")
|
||||
.HasForeignKey("ArtistMetadataId");
|
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
|
||||
.WithMany("Studios")
|
||||
.HasForeignKey("EpisodeMetadataId");
|
||||
@@ -1749,10 +1910,24 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Style",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
|
||||
.WithMany("Styles")
|
||||
.HasForeignKey("ArtistMetadataId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Tag",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
|
||||
.WithMany("Tags")
|
||||
.HasForeignKey("ArtistMetadataId");
|
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
|
||||
.WithMany("Tags")
|
||||
.HasForeignKey("EpisodeMetadataId");
|
||||
@@ -1810,6 +1985,17 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Artist",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
|
||||
.WithOne()
|
||||
.HasForeignKey("ErsatzTV.Core.Domain.Artist", "Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Episode",
|
||||
b =>
|
||||
@@ -1844,11 +2030,19 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
"ErsatzTV.Core.Domain.MusicVideo",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.Artist", "Artist")
|
||||
.WithMany("MusicVideos")
|
||||
.HasForeignKey("ArtistId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
|
||||
.WithOne()
|
||||
.HasForeignKey("ErsatzTV.Core.Domain.MusicVideo", "Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Artist");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
@@ -1991,6 +2185,23 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.ArtistMetadata",
|
||||
b =>
|
||||
{
|
||||
b.Navigation("Artwork");
|
||||
|
||||
b.Navigation("Genres");
|
||||
|
||||
b.Navigation("Moods");
|
||||
|
||||
b.Navigation("Studios");
|
||||
|
||||
b.Navigation("Styles");
|
||||
|
||||
b.Navigation("Tags");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Channel",
|
||||
b =>
|
||||
@@ -2102,6 +2313,15 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.Navigation("Tags");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Artist",
|
||||
b =>
|
||||
{
|
||||
b.Navigation("ArtistMetadata");
|
||||
|
||||
b.Navigation("MusicVideos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Episode",
|
||||
b =>
|
||||
|
||||
Reference in New Issue
Block a user