add emby media source (#201)
* properly scope jellyfin disconnect * add emby entities * add emby media source page * add emby media source editor * sync emby libraries * enable emby library sync toggle * add emby path replacements editor * add emby movie synchronization * fix emby artwork * sync emby television * code cleanup * add jellyfin/emby address placeholder * tweak jellyfin/emby address form
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,208 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ErsatzTV.Infrastructure.Migrations
|
||||
{
|
||||
public partial class Add_Emby : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
"EmbyEpisode",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>("INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ItemId = table.Column<string>("TEXT", nullable: true),
|
||||
Etag = table.Column<string>("TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmbyEpisode", x => x.Id);
|
||||
table.ForeignKey(
|
||||
"FK_EmbyEpisode_Episode_Id",
|
||||
x => x.Id,
|
||||
"Episode",
|
||||
"Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
"EmbyLibrary",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>("INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ItemId = table.Column<string>("TEXT", nullable: true),
|
||||
ShouldSyncItems = table.Column<bool>("INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmbyLibrary", x => x.Id);
|
||||
table.ForeignKey(
|
||||
"FK_EmbyLibrary_Library_Id",
|
||||
x => x.Id,
|
||||
"Library",
|
||||
"Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
"EmbyMediaSource",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>("INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ServerName = table.Column<string>("TEXT", nullable: true),
|
||||
OperatingSystem = table.Column<string>("TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmbyMediaSource", x => x.Id);
|
||||
table.ForeignKey(
|
||||
"FK_EmbyMediaSource_MediaSource_Id",
|
||||
x => x.Id,
|
||||
"MediaSource",
|
||||
"Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
"EmbyMovie",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>("INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ItemId = table.Column<string>("TEXT", nullable: true),
|
||||
Etag = table.Column<string>("TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmbyMovie", x => x.Id);
|
||||
table.ForeignKey(
|
||||
"FK_EmbyMovie_Movie_Id",
|
||||
x => x.Id,
|
||||
"Movie",
|
||||
"Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
"EmbySeason",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>("INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ItemId = table.Column<string>("TEXT", nullable: true),
|
||||
Etag = table.Column<string>("TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmbySeason", x => x.Id);
|
||||
table.ForeignKey(
|
||||
"FK_EmbySeason_Season_Id",
|
||||
x => x.Id,
|
||||
"Season",
|
||||
"Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
"EmbyShow",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>("INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ItemId = table.Column<string>("TEXT", nullable: true),
|
||||
Etag = table.Column<string>("TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmbyShow", x => x.Id);
|
||||
table.ForeignKey(
|
||||
"FK_EmbyShow_Show_Id",
|
||||
x => x.Id,
|
||||
"Show",
|
||||
"Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
"EmbyConnection",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>("INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Address = table.Column<string>("TEXT", nullable: true),
|
||||
EmbyMediaSourceId = table.Column<int>("INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmbyConnection", x => x.Id);
|
||||
table.ForeignKey(
|
||||
"FK_EmbyConnection_EmbyMediaSource_EmbyMediaSourceId",
|
||||
x => x.EmbyMediaSourceId,
|
||||
"EmbyMediaSource",
|
||||
"Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
"EmbyPathReplacement",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>("INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
EmbyPath = table.Column<string>("TEXT", nullable: true),
|
||||
LocalPath = table.Column<string>("TEXT", nullable: true),
|
||||
EmbyMediaSourceId = table.Column<int>("INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmbyPathReplacement", x => x.Id);
|
||||
table.ForeignKey(
|
||||
"FK_EmbyPathReplacement_EmbyMediaSource_EmbyMediaSourceId",
|
||||
x => x.EmbyMediaSourceId,
|
||||
"EmbyMediaSource",
|
||||
"Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
"IX_EmbyConnection_EmbyMediaSourceId",
|
||||
"EmbyConnection",
|
||||
"EmbyMediaSourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
"IX_EmbyPathReplacement_EmbyMediaSourceId",
|
||||
"EmbyPathReplacement",
|
||||
"EmbyMediaSourceId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
"EmbyConnection");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
"EmbyEpisode");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
"EmbyLibrary");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
"EmbyMovie");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
"EmbyPathReplacement");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
"EmbySeason");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
"EmbyShow");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
"EmbyMediaSource");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "5.0.4");
|
||||
.HasAnnotation("ProductVersion", "5.0.6");
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.Actor",
|
||||
@@ -282,6 +282,51 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.ToTable("ConfigElement");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbyConnection",
|
||||
b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("EmbyMediaSourceId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmbyMediaSourceId");
|
||||
|
||||
b.ToTable("EmbyConnection");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbyPathReplacement",
|
||||
b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("EmbyMediaSourceId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("EmbyPath")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LocalPath")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmbyMediaSourceId");
|
||||
|
||||
b.ToTable("EmbyPathReplacement");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EpisodeMetadata",
|
||||
b =>
|
||||
@@ -1281,6 +1326,21 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.ToTable("Tag");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbyLibrary",
|
||||
b =>
|
||||
{
|
||||
b.HasBaseType("ErsatzTV.Core.Domain.Library");
|
||||
|
||||
b.Property<string>("ItemId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("ShouldSyncItems")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.ToTable("EmbyLibrary");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.JellyfinLibrary",
|
||||
b =>
|
||||
@@ -1410,6 +1470,21 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.ToTable("Show");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbyMediaSource",
|
||||
b =>
|
||||
{
|
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaSource");
|
||||
|
||||
b.Property<string>("OperatingSystem")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ServerName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.ToTable("EmbyMediaSource");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.JellyfinMediaSource",
|
||||
b =>
|
||||
@@ -1503,6 +1578,21 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.ToTable("ProgramScheduleOneItem");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbyEpisode",
|
||||
b =>
|
||||
{
|
||||
b.HasBaseType("ErsatzTV.Core.Domain.Episode");
|
||||
|
||||
b.Property<string>("Etag")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ItemId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.ToTable("EmbyEpisode");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.JellyfinEpisode",
|
||||
b =>
|
||||
@@ -1530,6 +1620,21 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.ToTable("PlexEpisode");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbyMovie",
|
||||
b =>
|
||||
{
|
||||
b.HasBaseType("ErsatzTV.Core.Domain.Movie");
|
||||
|
||||
b.Property<string>("Etag")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ItemId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.ToTable("EmbyMovie");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.JellyfinMovie",
|
||||
b =>
|
||||
@@ -1557,6 +1662,21 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.ToTable("PlexMovie");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbySeason",
|
||||
b =>
|
||||
{
|
||||
b.HasBaseType("ErsatzTV.Core.Domain.Season");
|
||||
|
||||
b.Property<string>("Etag")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ItemId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.ToTable("EmbySeason");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.JellyfinSeason",
|
||||
b =>
|
||||
@@ -1584,6 +1704,21 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.ToTable("PlexSeason");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbyShow",
|
||||
b =>
|
||||
{
|
||||
b.HasBaseType("ErsatzTV.Core.Domain.Show");
|
||||
|
||||
b.Property<string>("Etag")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ItemId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.ToTable("EmbyShow");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.JellyfinShow",
|
||||
b =>
|
||||
@@ -1737,6 +1872,32 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.Navigation("MediaItem");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbyConnection",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.EmbyMediaSource", "EmbyMediaSource")
|
||||
.WithMany("Connections")
|
||||
.HasForeignKey("EmbyMediaSourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EmbyMediaSource");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbyPathReplacement",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.EmbyMediaSource", "EmbyMediaSource")
|
||||
.WithMany("PathReplacements")
|
||||
.HasForeignKey("EmbyMediaSourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EmbyMediaSource");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EpisodeMetadata",
|
||||
b =>
|
||||
@@ -2250,6 +2411,17 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbyLibrary",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.Library", null)
|
||||
.WithOne()
|
||||
.HasForeignKey("ErsatzTV.Core.Domain.EmbyLibrary", "Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.JellyfinLibrary",
|
||||
b =>
|
||||
@@ -2384,6 +2556,17 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbyMediaSource",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.MediaSource", null)
|
||||
.WithOne()
|
||||
.HasForeignKey("ErsatzTV.Core.Domain.EmbyMediaSource", "Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.JellyfinMediaSource",
|
||||
b =>
|
||||
@@ -2461,6 +2644,17 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbyEpisode",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.Episode", null)
|
||||
.WithOne()
|
||||
.HasForeignKey("ErsatzTV.Core.Domain.EmbyEpisode", "Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.JellyfinEpisode",
|
||||
b =>
|
||||
@@ -2483,6 +2677,17 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbyMovie",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.Movie", null)
|
||||
.WithOne()
|
||||
.HasForeignKey("ErsatzTV.Core.Domain.EmbyMovie", "Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.JellyfinMovie",
|
||||
b =>
|
||||
@@ -2505,6 +2710,17 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbySeason",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.Season", null)
|
||||
.WithOne()
|
||||
.HasForeignKey("ErsatzTV.Core.Domain.EmbySeason", "Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.JellyfinSeason",
|
||||
b =>
|
||||
@@ -2527,6 +2743,17 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbyShow",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("ErsatzTV.Core.Domain.Show", null)
|
||||
.WithOne()
|
||||
.HasForeignKey("ErsatzTV.Core.Domain.EmbyShow", "Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.JellyfinShow",
|
||||
b =>
|
||||
@@ -2750,6 +2977,15 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
b.Navigation("ShowMetadata");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.EmbyMediaSource",
|
||||
b =>
|
||||
{
|
||||
b.Navigation("Connections");
|
||||
|
||||
b.Navigation("PathReplacements");
|
||||
});
|
||||
|
||||
modelBuilder.Entity(
|
||||
"ErsatzTV.Core.Domain.JellyfinMediaSource",
|
||||
b =>
|
||||
|
||||
Reference in New Issue
Block a user