mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Reworking external ids for episodes, seasons & peoples
This commit is contained in:
parent
e54b86b16a
commit
49618ccd03
@ -1,7 +1,6 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Kyoo.Models
|
||||
{
|
||||
@ -24,7 +23,7 @@ namespace Kyoo.Models
|
||||
public long Runtime { get; set; } //This runtime variable should be in minutes
|
||||
|
||||
[JsonIgnore] public string ImgPrimary { get; set; }
|
||||
public string ExternalIDs { get; set; }
|
||||
public virtual IEnumerable<MetadataID> ExternalIDs { get; set; }
|
||||
|
||||
[JsonIgnore] public virtual IEnumerable<Track> Tracks { get; set; }
|
||||
|
||||
@ -33,14 +32,17 @@ namespace Kyoo.Models
|
||||
public string Thumb; //Used in the API response only
|
||||
|
||||
|
||||
public Episode()
|
||||
{
|
||||
SeasonNumber = -1;
|
||||
EpisodeNumber = -1;
|
||||
AbsoluteNumber = -1;
|
||||
}
|
||||
public Episode() { }
|
||||
|
||||
public Episode(long seasonNumber, long episodeNumber, long absoluteNumber, string title, string overview, DateTime? releaseDate, long runtime, string imgPrimary, string externalIDs)
|
||||
public Episode(long seasonNumber,
|
||||
long episodeNumber,
|
||||
long absoluteNumber,
|
||||
string title,
|
||||
string overview,
|
||||
DateTime? releaseDate,
|
||||
long runtime,
|
||||
string imgPrimary,
|
||||
IEnumerable<MetadataID> externalIDs)
|
||||
{
|
||||
SeasonNumber = seasonNumber;
|
||||
EpisodeNumber = episodeNumber;
|
||||
@ -53,7 +55,18 @@ namespace Kyoo.Models
|
||||
ExternalIDs = externalIDs;
|
||||
}
|
||||
|
||||
public Episode(long showID, long seasonID, long seasonNumber, long episodeNumber, long absoluteNumber, string path, string title, string overview, DateTime? releaseDate, long runtime, string imgPrimary, string externalIDs)
|
||||
public Episode(long showID,
|
||||
long seasonID,
|
||||
long seasonNumber,
|
||||
long episodeNumber,
|
||||
long absoluteNumber,
|
||||
string path,
|
||||
string title,
|
||||
string overview,
|
||||
DateTime? releaseDate,
|
||||
long runtime,
|
||||
string imgPrimary,
|
||||
IEnumerable<MetadataID> externalIDs)
|
||||
{
|
||||
ShowID = showID;
|
||||
SeasonID = seasonID;
|
||||
@ -111,7 +124,8 @@ namespace Kyoo.Models
|
||||
if (Runtime == -1)
|
||||
Runtime = other.Runtime;
|
||||
ImgPrimary ??= other.ImgPrimary;
|
||||
ExternalIDs = string.Join('|', new [] { ExternalIDs, other.ExternalIDs }.Where(x => !string.IsNullOrEmpty(x)));
|
||||
ExternalIDs = Utility.MergeLists(ExternalIDs, other.ExternalIDs,
|
||||
(x, y) => x.Provider.Name == y.Provider.Name);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -3,11 +3,21 @@ namespace Kyoo.Models
|
||||
public class MetadataID
|
||||
{
|
||||
public long ID { get; set; }
|
||||
public long ShowID { get; set; }
|
||||
public virtual Show Show { get; set; }
|
||||
public long ProviderID { get; set; }
|
||||
public virtual ProviderID Provider {get; set; }
|
||||
|
||||
public long? ShowID { get; set; }
|
||||
public virtual Show Show { get; set; }
|
||||
|
||||
public long? EpisodeID { get; set; }
|
||||
public virtual Episode Episode { get; set; }
|
||||
|
||||
public long? SeasonID { get; set; }
|
||||
public virtual Season Season { get; set; }
|
||||
|
||||
public long? PeopleID { get; set; }
|
||||
public virtual People People { get; set; }
|
||||
|
||||
public string DataID { get; set; }
|
||||
public string Link { get; set; }
|
||||
|
||||
|
@ -6,16 +6,17 @@ namespace Kyoo.Models
|
||||
{
|
||||
public class People : IMergable<People>
|
||||
{
|
||||
public long ID { get; set; }
|
||||
public string Slug { get; set; }
|
||||
public string Name { get; set; }
|
||||
[JsonIgnore] public string ImgPrimary { get; set; }
|
||||
public string ExternalIDs { get; set; }
|
||||
public virtual IEnumerable<MetadataID> ExternalIDs { get; set; }
|
||||
|
||||
[JsonIgnore] public virtual IEnumerable<PeopleLink> Roles { get; set; }
|
||||
|
||||
public People() {}
|
||||
|
||||
public People(string slug, string name, string imgPrimary, string externalIDs)
|
||||
public People(string slug, string name, string imgPrimary, IEnumerable<MetadataID> externalIDs)
|
||||
{
|
||||
Slug = slug;
|
||||
Name = name;
|
||||
@ -30,7 +31,8 @@ namespace Kyoo.Models
|
||||
Slug ??= other.Slug;
|
||||
Name ??= other.Name;
|
||||
ImgPrimary ??= other.ImgPrimary;
|
||||
ExternalIDs = string.Join('|', new [] { ExternalIDs, other.ExternalIDs }.Where(x => !string.IsNullOrEmpty(x)));
|
||||
ExternalIDs = Utility.MergeLists(ExternalIDs, other.ExternalIDs,
|
||||
(x, y) => x.Provider.Name == y.Provider.Name);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kyoo.Models
|
||||
@ -20,7 +21,7 @@ namespace Kyoo.Models
|
||||
set => People.Name = value;
|
||||
}
|
||||
|
||||
public string ExternalIDs
|
||||
public IEnumerable<MetadataID> ExternalIDs
|
||||
{
|
||||
get => People.ExternalIDs;
|
||||
set => People.ExternalIDs = value;
|
||||
@ -41,7 +42,7 @@ namespace Kyoo.Models
|
||||
Type = type;
|
||||
}
|
||||
|
||||
public PeopleLink(string slug, string name, string role, string type, string imgPrimary, string externalIDs)
|
||||
public PeopleLink(string slug, string name, string role, string type, string imgPrimary, IEnumerable<MetadataID> externalIDs)
|
||||
{
|
||||
People = new People(slug, name, imgPrimary, externalIDs);
|
||||
Role = role;
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kyoo.Models
|
||||
@ -15,14 +14,20 @@ namespace Kyoo.Models
|
||||
public long? Year { get; set; }
|
||||
|
||||
[JsonIgnore] public string ImgPrimary { get; set; }
|
||||
public string ExternalIDs { get; set; }
|
||||
public virtual IEnumerable<MetadataID> ExternalIDs { get; set; }
|
||||
|
||||
[JsonIgnore] public virtual Show Show { get; set; }
|
||||
[JsonIgnore] public virtual IEnumerable<Episode> Episodes { get; set; }
|
||||
|
||||
public Season() { }
|
||||
|
||||
public Season(long showID, long seasonNumber, string title, string overview, long? year, string imgPrimary, string externalIDs)
|
||||
public Season(long showID,
|
||||
long seasonNumber,
|
||||
string title,
|
||||
string overview,
|
||||
long? year,
|
||||
string imgPrimary,
|
||||
IEnumerable<MetadataID> externalIDs)
|
||||
{
|
||||
ShowID = showID;
|
||||
SeasonNumber = seasonNumber;
|
||||
@ -45,7 +50,8 @@ namespace Kyoo.Models
|
||||
Overview ??= other.Overview;
|
||||
Year ??= other.Year;
|
||||
ImgPrimary ??= other.ImgPrimary;
|
||||
ExternalIDs = string.Join('|', new [] { ExternalIDs, other.ExternalIDs }.Where(x => !string.IsNullOrEmpty(x)));
|
||||
ExternalIDs = Utility.MergeLists(ExternalIDs, other.ExternalIDs,
|
||||
(x, y) => x.Provider.Name == y.Provider.Name);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -114,7 +114,8 @@ namespace Kyoo.Models
|
||||
Slug ??= other.Slug;
|
||||
Title ??= other.Title;
|
||||
Aliases = Utility.MergeLists(Aliases, other.Aliases).ToArray();
|
||||
Genres = Utility.MergeLists(Genres, other.Genres, (x, y) => x.Slug == y.Slug);
|
||||
Genres = Utility.MergeLists(Genres, other.Genres,
|
||||
(x, y) => x.Slug == y.Slug);
|
||||
Path ??= other.Path;
|
||||
Overview ??= other.Overview;
|
||||
TrailerUrl ??= other.TrailerUrl;
|
||||
@ -126,7 +127,8 @@ namespace Kyoo.Models
|
||||
ImgLogo ??= other.ImgLogo;
|
||||
ImgBackdrop ??= other.ImgBackdrop;
|
||||
Studio ??= other.Studio;
|
||||
ExternalIDs = Utility.MergeLists(ExternalIDs, other.ExternalIDs, (x, y) => x.Provider != y.Provider);
|
||||
ExternalIDs = Utility.MergeLists(ExternalIDs, other.ExternalIDs,
|
||||
(x, y) => x.Provider.Name == y.Provider.Name);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -111,9 +111,6 @@ namespace Kyoo
|
||||
modelBuilder.Entity<Track>()
|
||||
.Property(t => t.IsForced)
|
||||
.ValueGeneratedNever();
|
||||
|
||||
modelBuilder.Entity<People>()
|
||||
.HasKey(x => x.Slug);
|
||||
|
||||
modelBuilder.Entity<GenreLink>()
|
||||
.HasKey(x => new {x.ShowID, x.GenreID});
|
||||
|
@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20200423203356_Initial")]
|
||||
[Migration("20200423211516_Initial")]
|
||||
partial class Initial
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@ -80,9 +80,6 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
b.Property<long>("EpisodeNumber")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ExternalIDs")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ImgPrimary")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
@ -212,19 +209,34 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
b.Property<string>("DataID")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long?>("EpisodeID")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Link")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long?>("PeopleID")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("ProviderID")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("ShowID")
|
||||
b.Property<long?>("SeasonID")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long?>("ShowID")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("EpisodeID");
|
||||
|
||||
b.HasIndex("PeopleID");
|
||||
|
||||
b.HasIndex("ProviderID");
|
||||
|
||||
b.HasIndex("SeasonID");
|
||||
|
||||
b.HasIndex("ShowID");
|
||||
|
||||
b.ToTable("MetadataIds");
|
||||
@ -232,11 +244,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
|
||||
modelBuilder.Entity("Kyoo.Models.People", b =>
|
||||
{
|
||||
b.Property<string>("Slug")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ExternalIDs")
|
||||
.HasColumnType("TEXT");
|
||||
b.Property<long>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ImgPrimary")
|
||||
.HasColumnType("TEXT");
|
||||
@ -244,7 +254,10 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Slug");
|
||||
b.Property<string>("Slug")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("Slug")
|
||||
.IsUnique();
|
||||
@ -261,6 +274,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
b.Property<string>("PeopleID")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long?>("PeopleID1")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Role")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
@ -272,7 +288,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("PeopleID");
|
||||
b.HasIndex("PeopleID1");
|
||||
|
||||
b.HasIndex("ShowID");
|
||||
|
||||
@ -328,9 +344,6 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ExternalIDs")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ImgPrimary")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
@ -537,24 +550,34 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
|
||||
modelBuilder.Entity("Kyoo.Models.MetadataID", b =>
|
||||
{
|
||||
b.HasOne("Kyoo.Models.Episode", "Episode")
|
||||
.WithMany("ExternalIDs")
|
||||
.HasForeignKey("EpisodeID");
|
||||
|
||||
b.HasOne("Kyoo.Models.People", "People")
|
||||
.WithMany("ExternalIDs")
|
||||
.HasForeignKey("PeopleID");
|
||||
|
||||
b.HasOne("Kyoo.Models.ProviderID", "Provider")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProviderID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Kyoo.Models.Season", "Season")
|
||||
.WithMany("ExternalIDs")
|
||||
.HasForeignKey("SeasonID");
|
||||
|
||||
b.HasOne("Kyoo.Models.Show", "Show")
|
||||
.WithMany("ExternalIDs")
|
||||
.HasForeignKey("ShowID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
.HasForeignKey("ShowID");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kyoo.Models.PeopleLink", b =>
|
||||
{
|
||||
b.HasOne("Kyoo.Models.People", "People")
|
||||
.WithMany("Roles")
|
||||
.HasForeignKey("PeopleID");
|
||||
.HasForeignKey("PeopleID1");
|
||||
|
||||
b.HasOne("Kyoo.Models.Show", "Show")
|
||||
.WithMany("People")
|
@ -57,14 +57,15 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
name: "Peoples",
|
||||
columns: table => new
|
||||
{
|
||||
Slug = table.Column<string>(nullable: false),
|
||||
ID = table.Column<long>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Slug = table.Column<string>(nullable: true),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
ImgPrimary = table.Column<string>(nullable: true),
|
||||
ExternalIDs = table.Column<string>(nullable: true)
|
||||
ImgPrimary = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Peoples", x => x.Slug);
|
||||
table.PrimaryKey("PK_Peoples", x => x.ID);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
@ -211,34 +212,6 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MetadataIds",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<long>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ShowID = table.Column<long>(nullable: false),
|
||||
ProviderID = table.Column<long>(nullable: false),
|
||||
DataID = table.Column<string>(nullable: true),
|
||||
Link = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_MetadataIds", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_MetadataIds_ProviderIds_ProviderID",
|
||||
column: x => x.ProviderID,
|
||||
principalTable: "ProviderIds",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_MetadataIds_Shows_ShowID",
|
||||
column: x => x.ShowID,
|
||||
principalTable: "Shows",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PeopleLinks",
|
||||
columns: table => new
|
||||
@ -246,6 +219,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
ID = table.Column<long>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
PeopleID = table.Column<string>(nullable: true),
|
||||
PeopleID1 = table.Column<long>(nullable: true),
|
||||
ShowID = table.Column<long>(nullable: false),
|
||||
Role = table.Column<string>(nullable: true),
|
||||
Type = table.Column<string>(nullable: true)
|
||||
@ -254,10 +228,10 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
{
|
||||
table.PrimaryKey("PK_PeopleLinks", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_PeopleLinks_Peoples_PeopleID",
|
||||
column: x => x.PeopleID,
|
||||
name: "FK_PeopleLinks_Peoples_PeopleID1",
|
||||
column: x => x.PeopleID1,
|
||||
principalTable: "Peoples",
|
||||
principalColumn: "Slug",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_PeopleLinks_Shows_ShowID",
|
||||
@ -311,8 +285,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
Title = table.Column<string>(nullable: true),
|
||||
Overview = table.Column<string>(nullable: true),
|
||||
Year = table.Column<long>(nullable: true),
|
||||
ImgPrimary = table.Column<string>(nullable: true),
|
||||
ExternalIDs = table.Column<string>(nullable: true)
|
||||
ImgPrimary = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@ -341,8 +314,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
Overview = table.Column<string>(nullable: true),
|
||||
ReleaseDate = table.Column<DateTime>(nullable: true),
|
||||
Runtime = table.Column<long>(nullable: false),
|
||||
ImgPrimary = table.Column<string>(nullable: true),
|
||||
ExternalIDs = table.Column<string>(nullable: true)
|
||||
ImgPrimary = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@ -361,6 +333,55 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MetadataIds",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<long>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ProviderID = table.Column<long>(nullable: false),
|
||||
ShowID = table.Column<long>(nullable: true),
|
||||
EpisodeID = table.Column<long>(nullable: true),
|
||||
SeasonID = table.Column<long>(nullable: true),
|
||||
PeopleID = table.Column<long>(nullable: true),
|
||||
DataID = table.Column<string>(nullable: true),
|
||||
Link = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_MetadataIds", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_MetadataIds_Episodes_EpisodeID",
|
||||
column: x => x.EpisodeID,
|
||||
principalTable: "Episodes",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_MetadataIds_Peoples_PeopleID",
|
||||
column: x => x.PeopleID,
|
||||
principalTable: "Peoples",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_MetadataIds_ProviderIds_ProviderID",
|
||||
column: x => x.ProviderID,
|
||||
principalTable: "ProviderIds",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_MetadataIds_Seasons_SeasonID",
|
||||
column: x => x.SeasonID,
|
||||
principalTable: "Seasons",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_MetadataIds_Shows_ShowID",
|
||||
column: x => x.ShowID,
|
||||
principalTable: "Shows",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Tracks",
|
||||
columns: table => new
|
||||
@ -446,20 +467,35 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
table: "LibraryLinks",
|
||||
column: "ShowID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MetadataIds_EpisodeID",
|
||||
table: "MetadataIds",
|
||||
column: "EpisodeID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MetadataIds_PeopleID",
|
||||
table: "MetadataIds",
|
||||
column: "PeopleID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MetadataIds_ProviderID",
|
||||
table: "MetadataIds",
|
||||
column: "ProviderID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MetadataIds_SeasonID",
|
||||
table: "MetadataIds",
|
||||
column: "SeasonID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MetadataIds_ShowID",
|
||||
table: "MetadataIds",
|
||||
column: "ShowID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PeopleLinks_PeopleID",
|
||||
name: "IX_PeopleLinks_PeopleID1",
|
||||
table: "PeopleLinks",
|
||||
column: "PeopleID");
|
||||
column: "PeopleID1");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PeopleLinks_ShowID",
|
@ -78,9 +78,6 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
b.Property<long>("EpisodeNumber")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ExternalIDs")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ImgPrimary")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
@ -210,19 +207,34 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
b.Property<string>("DataID")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long?>("EpisodeID")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Link")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long?>("PeopleID")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("ProviderID")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("ShowID")
|
||||
b.Property<long?>("SeasonID")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long?>("ShowID")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("EpisodeID");
|
||||
|
||||
b.HasIndex("PeopleID");
|
||||
|
||||
b.HasIndex("ProviderID");
|
||||
|
||||
b.HasIndex("SeasonID");
|
||||
|
||||
b.HasIndex("ShowID");
|
||||
|
||||
b.ToTable("MetadataIds");
|
||||
@ -230,11 +242,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
|
||||
modelBuilder.Entity("Kyoo.Models.People", b =>
|
||||
{
|
||||
b.Property<string>("Slug")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ExternalIDs")
|
||||
.HasColumnType("TEXT");
|
||||
b.Property<long>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ImgPrimary")
|
||||
.HasColumnType("TEXT");
|
||||
@ -242,7 +252,10 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Slug");
|
||||
b.Property<string>("Slug")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("Slug")
|
||||
.IsUnique();
|
||||
@ -259,6 +272,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
b.Property<string>("PeopleID")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long?>("PeopleID1")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Role")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
@ -270,7 +286,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("PeopleID");
|
||||
b.HasIndex("PeopleID1");
|
||||
|
||||
b.HasIndex("ShowID");
|
||||
|
||||
@ -326,9 +342,6 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ExternalIDs")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ImgPrimary")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
@ -535,24 +548,34 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||
|
||||
modelBuilder.Entity("Kyoo.Models.MetadataID", b =>
|
||||
{
|
||||
b.HasOne("Kyoo.Models.Episode", "Episode")
|
||||
.WithMany("ExternalIDs")
|
||||
.HasForeignKey("EpisodeID");
|
||||
|
||||
b.HasOne("Kyoo.Models.People", "People")
|
||||
.WithMany("ExternalIDs")
|
||||
.HasForeignKey("PeopleID");
|
||||
|
||||
b.HasOne("Kyoo.Models.ProviderID", "Provider")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProviderID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Kyoo.Models.Season", "Season")
|
||||
.WithMany("ExternalIDs")
|
||||
.HasForeignKey("SeasonID");
|
||||
|
||||
b.HasOne("Kyoo.Models.Show", "Show")
|
||||
.WithMany("ExternalIDs")
|
||||
.HasForeignKey("ShowID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
.HasForeignKey("ShowID");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kyoo.Models.PeopleLink", b =>
|
||||
{
|
||||
b.HasOne("Kyoo.Models.People", "People")
|
||||
.WithMany("Roles")
|
||||
.HasForeignKey("PeopleID");
|
||||
.HasForeignKey("PeopleID1");
|
||||
|
||||
b.HasOne("Kyoo.Models.Show", "Show")
|
||||
.WithMany("People")
|
||||
|
Loading…
x
Reference in New Issue
Block a user