diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 00000000..50209a07
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,17 @@
+
+
+ true
+ true
+ true
+
+
+
+
+
+
+
+
+
+ $(MSBuildThisFileDirectory)Kyoo.ruleset
+
+
diff --git a/Kyoo.Abstractions/Controllers/IApplication.cs b/Kyoo.Abstractions/Controllers/IApplication.cs
index 8e72280e..393011a5 100644
--- a/Kyoo.Abstractions/Controllers/IApplication.cs
+++ b/Kyoo.Abstractions/Controllers/IApplication.cs
@@ -16,9 +16,9 @@
void Restart();
///
- /// Get the data directory
+ /// Get the data directory.
///
- /// Retrieve the data directory where runtime data should be stored
+ /// Retrieve the data directory where runtime data should be stored.
string GetDataDirectory();
///
@@ -28,4 +28,4 @@
/// The configuration file name.
string GetConfigFile();
}
-}
\ No newline at end of file
+}
diff --git a/Kyoo.Abstractions/Controllers/IConfigurationManager.cs b/Kyoo.Abstractions/Controllers/IConfigurationManager.cs
index 73c649d1..1b32a665 100644
--- a/Kyoo.Abstractions/Controllers/IConfigurationManager.cs
+++ b/Kyoo.Abstractions/Controllers/IConfigurationManager.cs
@@ -14,12 +14,12 @@ namespace Kyoo.Abstractions.Controllers
public interface IConfigurationManager
{
///
- /// Add an editable configuration to the editable configuration list
+ /// Add an editable configuration to the editable configuration list.
///
/// The root path of the editable configuration. It should not be a nested type.
- /// The type of the configuration
+ /// The type of the configuration.
void AddTyped(string path);
-
+
///
/// Add an editable configuration to the editable configuration list.
/// WARNING: this method allow you to add an unmanaged type. This type won't be editable. This can be used
@@ -36,32 +36,33 @@ namespace Kyoo.Abstractions.Controllers
/// The root path of the editable configuration. It should not be a nested type.
/// The type of the configuration or null.
void Register(string path, [CanBeNull] Type type);
-
+
///
/// Get the value of a setting using it's path.
///
- /// The path of the resource (can be separated by ':' or '__')
+ /// The path of the resource (can be separated by ':' or '__').
/// No setting found at the given path.
- /// The value of the settings (if it's a strongly typed one, the given type is instantiated
+ /// The value of the settings (if it's a strongly typed one, the given type is instantiated.
object GetValue(string path);
-
+
///
/// Get the value of a setting using it's path.
/// If your don't need a strongly typed value, see .
///
- /// The path of the resource (can be separated by ':' or '__')
+ /// The path of the resource (can be separated by ':' or '__').
/// A type to strongly type your option.
- /// If your type is not the same as the registered type
+ /// If your type is not the same as the registered type.
/// No setting found at the given path.
- /// The value of the settings (if it's a strongly typed one, the given type is instantiated
+ /// The value of the settings (if it's a strongly typed one, the given type is instantiated.
T GetValue(string path);
-
+
///
/// Edit the value of a setting using it's path. Save it to the json file.
///
- /// The path of the resource (can be separated by ':' or '__')
- /// The new value of the resource
+ /// The path of the resource (can be separated by ':' or '__').
+ /// The new value of the resource.
/// No setting found at the given path.
+ /// A representing the asynchronous operation.
Task EditValue(string path, object value);
}
-}
\ No newline at end of file
+}
diff --git a/Kyoo.Abstractions/Controllers/IFileSystem.cs b/Kyoo.Abstractions/Controllers/IFileSystem.cs
index 36c5dd3b..5edacb50 100644
--- a/Kyoo.Abstractions/Controllers/IFileSystem.cs
+++ b/Kyoo.Abstractions/Controllers/IFileSystem.cs
@@ -8,7 +8,8 @@ using Microsoft.AspNetCore.Mvc;
namespace Kyoo.Abstractions.Controllers
{
///
- /// A service to abstract the file system to allow custom file systems (like distant file systems or external providers)
+ /// A service to abstract the file system to allow custom file systems
+ /// (like distant file systems or external providers).
///
public interface IFileSystem
{
@@ -16,10 +17,10 @@ namespace Kyoo.Abstractions.Controllers
///
/// Used for http queries returning a file. This should be used to return local files
- /// or proxy them from a distant server
+ /// or proxy them from a distant server.
///
///
- /// If no file exists at the given path or if the path is null, a NotFoundResult is returned
+ /// If no file exists at the given path or if the path is null, a NotFoundResult is returned
/// to handle it gracefully.
///
/// The path of the file.
@@ -42,7 +43,7 @@ namespace Kyoo.Abstractions.Controllers
/// If the file could not be found.
/// A reader to read the file.
public Task GetReader([NotNull] string path);
-
+
///
/// Read a file present at . The reader can be used in an arbitrary context.
/// To return files from an http endpoint, use .
@@ -80,7 +81,7 @@ namespace Kyoo.Abstractions.Controllers
/// The path of the directory
/// Should the search be recursive or not.
/// A list of files's path.
- public Task> ListFiles([NotNull] string path,
+ public Task> ListFiles([NotNull] string path,
SearchOption options = SearchOption.TopDirectoryOnly);
///
@@ -100,4 +101,4 @@ namespace Kyoo.Abstractions.Controllers
/// The extra directory of the resource.
public Task GetExtraDirectory([NotNull] T resource);
}
-}
\ No newline at end of file
+}
diff --git a/Kyoo.Abstractions/Controllers/IIdentifier.cs b/Kyoo.Abstractions/Controllers/IIdentifier.cs
index 8a9d07ed..cc3af0f2 100644
--- a/Kyoo.Abstractions/Controllers/IIdentifier.cs
+++ b/Kyoo.Abstractions/Controllers/IIdentifier.cs
@@ -21,7 +21,7 @@ namespace Kyoo.Abstractions.Controllers
/// If no metadata could be parsed for a type, null can be returned.
///
Task<(Collection, Show, Season, Episode)> Identify(string path);
-
+
///
/// Identify an external subtitle or track file from it's path and return the parsed metadata.
///
@@ -34,4 +34,4 @@ namespace Kyoo.Abstractions.Controllers
///
Task
public IdentificationFailedException()
: base("An identification failed.")
- {}
-
+ { }
+
///
/// Create a new with a custom message.
///
/// The message to use.
public IdentificationFailedException(string message)
: base(message)
- {}
-
+ { }
+
///
- /// The serialization constructor
+ /// The serialization constructor
///
/// Serialization infos
/// The serialization context
@@ -34,4 +34,4 @@ namespace Kyoo.Abstractions.Models.Exceptions
: base(info, context)
{ }
}
-}
\ No newline at end of file
+}
diff --git a/Kyoo.Abstractions/Models/Exceptions/ItemNotFoundException.cs b/Kyoo.Abstractions/Models/Exceptions/ItemNotFoundException.cs
index 5a16e62e..02928897 100644
--- a/Kyoo.Abstractions/Models/Exceptions/ItemNotFoundException.cs
+++ b/Kyoo.Abstractions/Models/Exceptions/ItemNotFoundException.cs
@@ -12,7 +12,7 @@ namespace Kyoo.Abstractions.Models.Exceptions
///
/// Create a default with no message.
///
- public ItemNotFoundException() {}
+ public ItemNotFoundException() { }
///
/// Create a new with a message
@@ -21,9 +21,9 @@ namespace Kyoo.Abstractions.Models.Exceptions
public ItemNotFoundException(string message)
: base(message)
{ }
-
+
///
- /// The serialization constructor
+ /// The serialization constructor
///
/// Serialization infos
/// The serialization context
@@ -31,4 +31,4 @@ namespace Kyoo.Abstractions.Models.Exceptions
: base(info, context)
{ }
}
-}
\ No newline at end of file
+}
diff --git a/Kyoo.Core/Kyoo.Core.csproj b/Kyoo.Core/Kyoo.Core.csproj
index 917b5a31..f01a160a 100644
--- a/Kyoo.Core/Kyoo.Core.csproj
+++ b/Kyoo.Core/Kyoo.Core.csproj
@@ -9,12 +9,6 @@
https://github.com/AnonymusRaccoon/Kyoo
default
-
-
- true
- true
- true
-
transcoder.dll
@@ -58,14 +52,14 @@
-
+
PreserveNewest
false
-
+
diff --git a/Kyoo.Core/Views/LibraryApi.cs b/Kyoo.Core/Views/LibraryApi.cs
index 60991589..6dd4faba 100644
--- a/Kyoo.Core/Views/LibraryApi.cs
+++ b/Kyoo.Core/Views/LibraryApi.cs
@@ -1,12 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models;
using Kyoo.Abstractions.Models.Permissions;
using Kyoo.Core.Models.Options;
+using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
namespace Kyoo.Core.Api
@@ -33,11 +33,11 @@ namespace Kyoo.Core.Api
ActionResult result = await base.Create(resource);
if (result.Value != null)
_taskManager.StartTask("scan",
- new Progress(),
+ new Progress(),
new Dictionary {{"slug", result.Value.Slug}});
return result;
}
-
+
[HttpGet("{id:int}/show")]
[HttpGet("{id:int}/shows")]
[PartialPermission(Kind.Read)]
@@ -89,7 +89,7 @@ namespace Kyoo.Core.Api
return BadRequest(new {Error = ex.Message});
}
}
-
+
[HttpGet("{id:int}/collection")]
[HttpGet("{id:int}/collections")]
[PartialPermission(Kind.Read)]
@@ -141,7 +141,7 @@ namespace Kyoo.Core.Api
return BadRequest(new {Error = ex.Message});
}
}
-
+
[HttpGet("{id:int}/item")]
[HttpGet("{id:int}/items")]
[PartialPermission(Kind.Read)]
@@ -167,7 +167,7 @@ namespace Kyoo.Core.Api
return BadRequest(new {Error = ex.Message});
}
}
-
+
[HttpGet("{slug}/item")]
[HttpGet("{slug}/items")]
[PartialPermission(Kind.Read)]
@@ -194,4 +194,4 @@ namespace Kyoo.Core.Api
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Kyoo.Host.WindowsTrait/Kyoo.Host.WindowsTrait.csproj b/Kyoo.Host.WindowsTrait/Kyoo.Host.WindowsTrait.csproj
index 41ab83db..3c9645d5 100644
--- a/Kyoo.Host.WindowsTrait/Kyoo.Host.WindowsTrait.csproj
+++ b/Kyoo.Host.WindowsTrait/Kyoo.Host.WindowsTrait.csproj
@@ -1,12 +1,8 @@
-
- true
-
-
-
+
-
\ No newline at end of file
+
diff --git a/Kyoo.SqLite/Migrations/20210801171534_Initial.cs b/Kyoo.SqLite/Migrations/20210801171534_Initial.cs
index a7e62b03..70d605d6 100644
--- a/Kyoo.SqLite/Migrations/20210801171534_Initial.cs
+++ b/Kyoo.SqLite/Migrations/20210801171534_Initial.cs
@@ -3,836 +3,836 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace Kyoo.SqLite.Migrations
{
- public partial class Initial : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Collections",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Name = table.Column(type: "TEXT", nullable: true),
- Images = table.Column(type: "TEXT", nullable: true),
- Overview = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Collections", x => x.ID);
- });
-
- migrationBuilder.CreateTable(
- name: "Genres",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Name = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Genres", x => x.ID);
- });
-
- migrationBuilder.CreateTable(
- name: "Libraries",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Name = table.Column(type: "TEXT", nullable: true),
- Paths = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Libraries", x => x.ID);
- });
-
- migrationBuilder.CreateTable(
- name: "People",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Name = table.Column(type: "TEXT", nullable: true),
- Images = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_People", x => x.ID);
- });
-
- migrationBuilder.CreateTable(
- name: "Providers",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Name = table.Column(type: "TEXT", nullable: true),
- Images = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Providers", x => x.ID);
- });
-
- migrationBuilder.CreateTable(
- name: "Studios",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Name = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Studios", x => x.ID);
- });
-
- migrationBuilder.CreateTable(
- name: "Users",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Username = table.Column(type: "TEXT", nullable: true),
- Email = table.Column(type: "TEXT", nullable: true),
- Password = table.Column(type: "TEXT", nullable: true),
- Permissions = table.Column(type: "TEXT", nullable: true),
- ExtraData = table.Column(type: "TEXT", nullable: true),
- Images = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Users", x => x.ID);
- });
-
- migrationBuilder.CreateTable(
- name: "LinkLibraryCollection",
- columns: table => new
- {
- CollectionID = table.Column(type: "INTEGER", nullable: false),
- LibraryID = table.Column(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_LinkLibraryCollection", x => new { x.CollectionID, x.LibraryID });
- table.ForeignKey(
- name: "FK_LinkLibraryCollection_Collections_CollectionID",
- column: x => x.CollectionID,
- principalTable: "Collections",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_LinkLibraryCollection_Libraries_LibraryID",
- column: x => x.LibraryID,
- principalTable: "Libraries",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "CollectionMetadataID",
- columns: table => new
- {
- ResourceID = table.Column(type: "INTEGER", nullable: false),
- ProviderID = table.Column(type: "INTEGER", nullable: false),
- DataID = table.Column(type: "TEXT", nullable: true),
- Link = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_CollectionMetadataID", x => new { x.ResourceID, x.ProviderID });
- table.ForeignKey(
- name: "FK_CollectionMetadataID_Collections_ResourceID",
- column: x => x.ResourceID,
- principalTable: "Collections",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_CollectionMetadataID_Providers_ProviderID",
- column: x => x.ProviderID,
- principalTable: "Providers",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "LinkLibraryProvider",
- columns: table => new
- {
- LibraryID = table.Column(type: "INTEGER", nullable: false),
- ProviderID = table.Column(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_LinkLibraryProvider", x => new { x.LibraryID, x.ProviderID });
- table.ForeignKey(
- name: "FK_LinkLibraryProvider_Libraries_LibraryID",
- column: x => x.LibraryID,
- principalTable: "Libraries",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_LinkLibraryProvider_Providers_ProviderID",
- column: x => x.ProviderID,
- principalTable: "Providers",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "PeopleMetadataID",
- columns: table => new
- {
- ResourceID = table.Column(type: "INTEGER", nullable: false),
- ProviderID = table.Column(type: "INTEGER", nullable: false),
- DataID = table.Column(type: "TEXT", nullable: true),
- Link = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_PeopleMetadataID", x => new { x.ResourceID, x.ProviderID });
- table.ForeignKey(
- name: "FK_PeopleMetadataID_People_ResourceID",
- column: x => x.ResourceID,
- principalTable: "People",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_PeopleMetadataID_Providers_ProviderID",
- column: x => x.ProviderID,
- principalTable: "Providers",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "Shows",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Title = table.Column(type: "TEXT", nullable: true),
- Aliases = table.Column(type: "TEXT", nullable: true),
- Path = table.Column(type: "TEXT", nullable: true),
- Overview = table.Column(type: "TEXT", nullable: true),
- Status = table.Column(type: "INTEGER", nullable: false),
- StartAir = table.Column(type: "TEXT", nullable: true),
- EndAir = table.Column(type: "TEXT", nullable: true),
- Images = table.Column(type: "TEXT", nullable: true),
- IsMovie = table.Column(type: "INTEGER", nullable: false),
- StudioID = table.Column(type: "INTEGER", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Shows", x => x.ID);
- table.ForeignKey(
- name: "FK_Shows_Studios_StudioID",
- column: x => x.StudioID,
- principalTable: "Studios",
- principalColumn: "ID",
- onDelete: ReferentialAction.SetNull);
- });
-
- migrationBuilder.CreateTable(
- name: "StudioMetadataID",
- columns: table => new
- {
- ResourceID = table.Column(type: "INTEGER", nullable: false),
- ProviderID = table.Column(type: "INTEGER", nullable: false),
- DataID = table.Column(type: "TEXT", nullable: true),
- Link = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_StudioMetadataID", x => new { x.ResourceID, x.ProviderID });
- table.ForeignKey(
- name: "FK_StudioMetadataID_Providers_ProviderID",
- column: x => x.ProviderID,
- principalTable: "Providers",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_StudioMetadataID_Studios_ResourceID",
- column: x => x.ResourceID,
- principalTable: "Studios",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "LinkCollectionShow",
- columns: table => new
- {
- CollectionID = table.Column(type: "INTEGER", nullable: false),
- ShowID = table.Column(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_LinkCollectionShow", x => new { x.CollectionID, x.ShowID });
- table.ForeignKey(
- name: "FK_LinkCollectionShow_Collections_CollectionID",
- column: x => x.CollectionID,
- principalTable: "Collections",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_LinkCollectionShow_Shows_ShowID",
- column: x => x.ShowID,
- principalTable: "Shows",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "LinkLibraryShow",
- columns: table => new
- {
- LibraryID = table.Column(type: "INTEGER", nullable: false),
- ShowID = table.Column(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_LinkLibraryShow", x => new { x.LibraryID, x.ShowID });
- table.ForeignKey(
- name: "FK_LinkLibraryShow_Libraries_LibraryID",
- column: x => x.LibraryID,
- principalTable: "Libraries",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_LinkLibraryShow_Shows_ShowID",
- column: x => x.ShowID,
- principalTable: "Shows",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "LinkShowGenre",
- columns: table => new
- {
- GenreID = table.Column(type: "INTEGER", nullable: false),
- ShowID = table.Column(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_LinkShowGenre", x => new { x.GenreID, x.ShowID });
- table.ForeignKey(
- name: "FK_LinkShowGenre_Genres_GenreID",
- column: x => x.GenreID,
- principalTable: "Genres",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_LinkShowGenre_Shows_ShowID",
- column: x => x.ShowID,
- principalTable: "Shows",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "LinkUserShow",
- columns: table => new
- {
- UsersID = table.Column(type: "INTEGER", nullable: false),
- WatchedID = table.Column(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_LinkUserShow", x => new { x.UsersID, x.WatchedID });
- table.ForeignKey(
- name: "FK_LinkUserShow_Shows_WatchedID",
- column: x => x.WatchedID,
- principalTable: "Shows",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_LinkUserShow_Users_UsersID",
- column: x => x.UsersID,
- principalTable: "Users",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "PeopleRoles",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- PeopleID = table.Column(type: "INTEGER", nullable: false),
- ShowID = table.Column(type: "INTEGER", nullable: false),
- Type = table.Column(type: "TEXT", nullable: true),
- Role = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_PeopleRoles", x => x.ID);
- table.ForeignKey(
- name: "FK_PeopleRoles_People_PeopleID",
- column: x => x.PeopleID,
- principalTable: "People",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_PeopleRoles_Shows_ShowID",
- column: x => x.ShowID,
- principalTable: "Shows",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "Seasons",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: true),
- ShowID = table.Column(type: "INTEGER", nullable: false),
- SeasonNumber = table.Column(type: "INTEGER", nullable: false),
- Title = table.Column(type: "TEXT", nullable: true),
- Overview = table.Column(type: "TEXT", nullable: true),
- StartDate = table.Column(type: "TEXT", nullable: true),
- EndDate = table.Column(type: "TEXT", nullable: true),
- Images = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Seasons", x => x.ID);
- table.ForeignKey(
- name: "FK_Seasons_Shows_ShowID",
- column: x => x.ShowID,
- principalTable: "Shows",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "ShowMetadataID",
- columns: table => new
- {
- ResourceID = table.Column(type: "INTEGER", nullable: false),
- ProviderID = table.Column(type: "INTEGER", nullable: false),
- DataID = table.Column(type: "TEXT", nullable: true),
- Link = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ShowMetadataID", x => new { x.ResourceID, x.ProviderID });
- table.ForeignKey(
- name: "FK_ShowMetadataID_Providers_ProviderID",
- column: x => x.ProviderID,
- principalTable: "Providers",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_ShowMetadataID_Shows_ResourceID",
- column: x => x.ResourceID,
- principalTable: "Shows",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "Episodes",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: true),
- ShowID = table.Column(type: "INTEGER", nullable: false),
- SeasonID = table.Column(type: "INTEGER", nullable: true),
- SeasonNumber = table.Column(type: "INTEGER", nullable: true),
- EpisodeNumber = table.Column(type: "INTEGER", nullable: true),
- AbsoluteNumber = table.Column(type: "INTEGER", nullable: true),
- Path = table.Column(type: "TEXT", nullable: true),
- Images = table.Column(type: "TEXT", nullable: true),
- Title = table.Column(type: "TEXT", nullable: true),
- Overview = table.Column(type: "TEXT", nullable: true),
- ReleaseDate = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Episodes", x => x.ID);
- table.ForeignKey(
- name: "FK_Episodes_Seasons_SeasonID",
- column: x => x.SeasonID,
- principalTable: "Seasons",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_Episodes_Shows_ShowID",
- column: x => x.ShowID,
- principalTable: "Shows",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "SeasonMetadataID",
- columns: table => new
- {
- ResourceID = table.Column(type: "INTEGER", nullable: false),
- ProviderID = table.Column(type: "INTEGER", nullable: false),
- DataID = table.Column(type: "TEXT", nullable: true),
- Link = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_SeasonMetadataID", x => new { x.ResourceID, x.ProviderID });
- table.ForeignKey(
- name: "FK_SeasonMetadataID_Providers_ProviderID",
- column: x => x.ProviderID,
- principalTable: "Providers",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_SeasonMetadataID_Seasons_ResourceID",
- column: x => x.ResourceID,
- principalTable: "Seasons",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "EpisodeMetadataID",
- columns: table => new
- {
- ResourceID = table.Column(type: "INTEGER", nullable: false),
- ProviderID = table.Column(type: "INTEGER", nullable: false),
- DataID = table.Column(type: "TEXT", nullable: true),
- Link = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_EpisodeMetadataID", x => new { x.ResourceID, x.ProviderID });
- table.ForeignKey(
- name: "FK_EpisodeMetadataID_Episodes_ResourceID",
- column: x => x.ResourceID,
- principalTable: "Episodes",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_EpisodeMetadataID_Providers_ProviderID",
- column: x => x.ProviderID,
- principalTable: "Providers",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "Tracks",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: true),
- Title = table.Column(type: "TEXT", nullable: true),
- Language = table.Column(type: "TEXT", nullable: true),
- Codec = table.Column(type: "TEXT", nullable: true),
- IsDefault = table.Column(type: "INTEGER", nullable: false),
- IsForced = table.Column(type: "INTEGER", nullable: false),
- IsExternal = table.Column(type: "INTEGER", nullable: false),
- Path = table.Column(type: "TEXT", nullable: true),
- Type = table.Column(type: "INTEGER", nullable: false),
- EpisodeID = table.Column(type: "INTEGER", nullable: false),
- TrackIndex = table.Column(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Tracks", x => x.ID);
- table.ForeignKey(
- name: "FK_Tracks_Episodes_EpisodeID",
- column: x => x.EpisodeID,
- principalTable: "Episodes",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "WatchedEpisodes",
- columns: table => new
- {
- UserID = table.Column(type: "INTEGER", nullable: false),
- EpisodeID = table.Column(type: "INTEGER", nullable: false),
- WatchedPercentage = table.Column(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_WatchedEpisodes", x => new { x.UserID, x.EpisodeID });
- table.ForeignKey(
- name: "FK_WatchedEpisodes_Episodes_EpisodeID",
- column: x => x.EpisodeID,
- principalTable: "Episodes",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_WatchedEpisodes_Users_UserID",
- column: x => x.UserID,
- principalTable: "Users",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_CollectionMetadataID_ProviderID",
- table: "CollectionMetadataID",
- column: "ProviderID");
-
- migrationBuilder.CreateIndex(
- name: "IX_Collections_Slug",
- table: "Collections",
- column: "Slug",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_EpisodeMetadataID_ProviderID",
- table: "EpisodeMetadataID",
- column: "ProviderID");
-
- migrationBuilder.CreateIndex(
- name: "IX_Episodes_SeasonID",
- table: "Episodes",
- column: "SeasonID");
-
- migrationBuilder.CreateIndex(
- name: "IX_Episodes_ShowID_SeasonNumber_EpisodeNumber_AbsoluteNumber",
- table: "Episodes",
- columns: new[] { "ShowID", "SeasonNumber", "EpisodeNumber", "AbsoluteNumber" },
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_Episodes_Slug",
- table: "Episodes",
- column: "Slug",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_Genres_Slug",
- table: "Genres",
- column: "Slug",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_Libraries_Slug",
- table: "Libraries",
- column: "Slug",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_LinkCollectionShow_ShowID",
- table: "LinkCollectionShow",
- column: "ShowID");
-
- migrationBuilder.CreateIndex(
- name: "IX_LinkLibraryCollection_LibraryID",
- table: "LinkLibraryCollection",
- column: "LibraryID");
-
- migrationBuilder.CreateIndex(
- name: "IX_LinkLibraryProvider_ProviderID",
- table: "LinkLibraryProvider",
- column: "ProviderID");
-
- migrationBuilder.CreateIndex(
- name: "IX_LinkLibraryShow_ShowID",
- table: "LinkLibraryShow",
- column: "ShowID");
-
- migrationBuilder.CreateIndex(
- name: "IX_LinkShowGenre_ShowID",
- table: "LinkShowGenre",
- column: "ShowID");
-
- migrationBuilder.CreateIndex(
- name: "IX_LinkUserShow_WatchedID",
- table: "LinkUserShow",
- column: "WatchedID");
-
- migrationBuilder.CreateIndex(
- name: "IX_People_Slug",
- table: "People",
- column: "Slug",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_PeopleMetadataID_ProviderID",
- table: "PeopleMetadataID",
- column: "ProviderID");
-
- migrationBuilder.CreateIndex(
- name: "IX_PeopleRoles_PeopleID",
- table: "PeopleRoles",
- column: "PeopleID");
-
- migrationBuilder.CreateIndex(
- name: "IX_PeopleRoles_ShowID",
- table: "PeopleRoles",
- column: "ShowID");
-
- migrationBuilder.CreateIndex(
- name: "IX_Providers_Slug",
- table: "Providers",
- column: "Slug",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_SeasonMetadataID_ProviderID",
- table: "SeasonMetadataID",
- column: "ProviderID");
-
- migrationBuilder.CreateIndex(
- name: "IX_Seasons_ShowID_SeasonNumber",
- table: "Seasons",
- columns: new[] { "ShowID", "SeasonNumber" },
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_Seasons_Slug",
- table: "Seasons",
- column: "Slug",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_ShowMetadataID_ProviderID",
- table: "ShowMetadataID",
- column: "ProviderID");
-
- migrationBuilder.CreateIndex(
- name: "IX_Shows_Slug",
- table: "Shows",
- column: "Slug",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_Shows_StudioID",
- table: "Shows",
- column: "StudioID");
-
- migrationBuilder.CreateIndex(
- name: "IX_StudioMetadataID_ProviderID",
- table: "StudioMetadataID",
- column: "ProviderID");
-
- migrationBuilder.CreateIndex(
- name: "IX_Studios_Slug",
- table: "Studios",
- column: "Slug",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_Tracks_EpisodeID_Type_Language_TrackIndex_IsForced",
- table: "Tracks",
- columns: new[] { "EpisodeID", "Type", "Language", "TrackIndex", "IsForced" },
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_Tracks_Slug",
- table: "Tracks",
- column: "Slug",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_Users_Slug",
- table: "Users",
- column: "Slug",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_WatchedEpisodes_EpisodeID",
- table: "WatchedEpisodes",
- column: "EpisodeID");
- }
-
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "CollectionMetadataID");
-
- migrationBuilder.DropTable(
- name: "EpisodeMetadataID");
-
- migrationBuilder.DropTable(
- name: "LinkCollectionShow");
-
- migrationBuilder.DropTable(
- name: "LinkLibraryCollection");
-
- migrationBuilder.DropTable(
- name: "LinkLibraryProvider");
-
- migrationBuilder.DropTable(
- name: "LinkLibraryShow");
+ public partial class Initial : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "Collections",
+ columns: table => new
+ {
+ ID = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Slug = table.Column(type: "TEXT", nullable: false),
+ Name = table.Column(type: "TEXT", nullable: true),
+ Images = table.Column(type: "TEXT", nullable: true),
+ Overview = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Collections", x => x.ID);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Genres",
+ columns: table => new
+ {
+ ID = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Slug = table.Column(type: "TEXT", nullable: false),
+ Name = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Genres", x => x.ID);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Libraries",
+ columns: table => new
+ {
+ ID = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Slug = table.Column(type: "TEXT", nullable: false),
+ Name = table.Column(type: "TEXT", nullable: true),
+ Paths = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Libraries", x => x.ID);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "People",
+ columns: table => new
+ {
+ ID = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Slug = table.Column(type: "TEXT", nullable: false),
+ Name = table.Column(type: "TEXT", nullable: true),
+ Images = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_People", x => x.ID);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Providers",
+ columns: table => new
+ {
+ ID = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Slug = table.Column(type: "TEXT", nullable: false),
+ Name = table.Column(type: "TEXT", nullable: true),
+ Images = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Providers", x => x.ID);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Studios",
+ columns: table => new
+ {
+ ID = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Slug = table.Column(type: "TEXT", nullable: false),
+ Name = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Studios", x => x.ID);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Users",
+ columns: table => new
+ {
+ ID = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Slug = table.Column(type: "TEXT", nullable: false),
+ Username = table.Column(type: "TEXT", nullable: true),
+ Email = table.Column(type: "TEXT", nullable: true),
+ Password = table.Column(type: "TEXT", nullable: true),
+ Permissions = table.Column(type: "TEXT", nullable: true),
+ ExtraData = table.Column(type: "TEXT", nullable: true),
+ Images = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Users", x => x.ID);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "LinkLibraryCollection",
+ columns: table => new
+ {
+ CollectionID = table.Column(type: "INTEGER", nullable: false),
+ LibraryID = table.Column(type: "INTEGER", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_LinkLibraryCollection", x => new { x.CollectionID, x.LibraryID });
+ table.ForeignKey(
+ name: "FK_LinkLibraryCollection_Collections_CollectionID",
+ column: x => x.CollectionID,
+ principalTable: "Collections",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_LinkLibraryCollection_Libraries_LibraryID",
+ column: x => x.LibraryID,
+ principalTable: "Libraries",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "CollectionMetadataID",
+ columns: table => new
+ {
+ ResourceID = table.Column(type: "INTEGER", nullable: false),
+ ProviderID = table.Column(type: "INTEGER", nullable: false),
+ DataID = table.Column(type: "TEXT", nullable: true),
+ Link = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_CollectionMetadataID", x => new { x.ResourceID, x.ProviderID });
+ table.ForeignKey(
+ name: "FK_CollectionMetadataID_Collections_ResourceID",
+ column: x => x.ResourceID,
+ principalTable: "Collections",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_CollectionMetadataID_Providers_ProviderID",
+ column: x => x.ProviderID,
+ principalTable: "Providers",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "LinkLibraryProvider",
+ columns: table => new
+ {
+ LibraryID = table.Column(type: "INTEGER", nullable: false),
+ ProviderID = table.Column(type: "INTEGER", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_LinkLibraryProvider", x => new { x.LibraryID, x.ProviderID });
+ table.ForeignKey(
+ name: "FK_LinkLibraryProvider_Libraries_LibraryID",
+ column: x => x.LibraryID,
+ principalTable: "Libraries",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_LinkLibraryProvider_Providers_ProviderID",
+ column: x => x.ProviderID,
+ principalTable: "Providers",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "PeopleMetadataID",
+ columns: table => new
+ {
+ ResourceID = table.Column(type: "INTEGER", nullable: false),
+ ProviderID = table.Column(type: "INTEGER", nullable: false),
+ DataID = table.Column(type: "TEXT", nullable: true),
+ Link = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_PeopleMetadataID", x => new { x.ResourceID, x.ProviderID });
+ table.ForeignKey(
+ name: "FK_PeopleMetadataID_People_ResourceID",
+ column: x => x.ResourceID,
+ principalTable: "People",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_PeopleMetadataID_Providers_ProviderID",
+ column: x => x.ProviderID,
+ principalTable: "Providers",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Shows",
+ columns: table => new
+ {
+ ID = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Slug = table.Column(type: "TEXT", nullable: false),
+ Title = table.Column(type: "TEXT", nullable: true),
+ Aliases = table.Column(type: "TEXT", nullable: true),
+ Path = table.Column(type: "TEXT", nullable: true),
+ Overview = table.Column(type: "TEXT", nullable: true),
+ Status = table.Column(type: "INTEGER", nullable: false),
+ StartAir = table.Column(type: "TEXT", nullable: true),
+ EndAir = table.Column(type: "TEXT", nullable: true),
+ Images = table.Column(type: "TEXT", nullable: true),
+ IsMovie = table.Column(type: "INTEGER", nullable: false),
+ StudioID = table.Column(type: "INTEGER", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Shows", x => x.ID);
+ table.ForeignKey(
+ name: "FK_Shows_Studios_StudioID",
+ column: x => x.StudioID,
+ principalTable: "Studios",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.SetNull);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "StudioMetadataID",
+ columns: table => new
+ {
+ ResourceID = table.Column(type: "INTEGER", nullable: false),
+ ProviderID = table.Column(type: "INTEGER", nullable: false),
+ DataID = table.Column(type: "TEXT", nullable: true),
+ Link = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_StudioMetadataID", x => new { x.ResourceID, x.ProviderID });
+ table.ForeignKey(
+ name: "FK_StudioMetadataID_Providers_ProviderID",
+ column: x => x.ProviderID,
+ principalTable: "Providers",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_StudioMetadataID_Studios_ResourceID",
+ column: x => x.ResourceID,
+ principalTable: "Studios",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "LinkCollectionShow",
+ columns: table => new
+ {
+ CollectionID = table.Column(type: "INTEGER", nullable: false),
+ ShowID = table.Column(type: "INTEGER", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_LinkCollectionShow", x => new { x.CollectionID, x.ShowID });
+ table.ForeignKey(
+ name: "FK_LinkCollectionShow_Collections_CollectionID",
+ column: x => x.CollectionID,
+ principalTable: "Collections",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_LinkCollectionShow_Shows_ShowID",
+ column: x => x.ShowID,
+ principalTable: "Shows",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "LinkLibraryShow",
+ columns: table => new
+ {
+ LibraryID = table.Column(type: "INTEGER", nullable: false),
+ ShowID = table.Column(type: "INTEGER", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_LinkLibraryShow", x => new { x.LibraryID, x.ShowID });
+ table.ForeignKey(
+ name: "FK_LinkLibraryShow_Libraries_LibraryID",
+ column: x => x.LibraryID,
+ principalTable: "Libraries",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_LinkLibraryShow_Shows_ShowID",
+ column: x => x.ShowID,
+ principalTable: "Shows",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "LinkShowGenre",
+ columns: table => new
+ {
+ GenreID = table.Column(type: "INTEGER", nullable: false),
+ ShowID = table.Column(type: "INTEGER", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_LinkShowGenre", x => new { x.GenreID, x.ShowID });
+ table.ForeignKey(
+ name: "FK_LinkShowGenre_Genres_GenreID",
+ column: x => x.GenreID,
+ principalTable: "Genres",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_LinkShowGenre_Shows_ShowID",
+ column: x => x.ShowID,
+ principalTable: "Shows",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "LinkUserShow",
+ columns: table => new
+ {
+ UsersID = table.Column(type: "INTEGER", nullable: false),
+ WatchedID = table.Column(type: "INTEGER", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_LinkUserShow", x => new { x.UsersID, x.WatchedID });
+ table.ForeignKey(
+ name: "FK_LinkUserShow_Shows_WatchedID",
+ column: x => x.WatchedID,
+ principalTable: "Shows",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_LinkUserShow_Users_UsersID",
+ column: x => x.UsersID,
+ principalTable: "Users",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "PeopleRoles",
+ columns: table => new
+ {
+ ID = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ PeopleID = table.Column(type: "INTEGER", nullable: false),
+ ShowID = table.Column(type: "INTEGER", nullable: false),
+ Type = table.Column(type: "TEXT", nullable: true),
+ Role = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_PeopleRoles", x => x.ID);
+ table.ForeignKey(
+ name: "FK_PeopleRoles_People_PeopleID",
+ column: x => x.PeopleID,
+ principalTable: "People",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_PeopleRoles_Shows_ShowID",
+ column: x => x.ShowID,
+ principalTable: "Shows",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Seasons",
+ columns: table => new
+ {
+ ID = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Slug = table.Column(type: "TEXT", nullable: true),
+ ShowID = table.Column(type: "INTEGER", nullable: false),
+ SeasonNumber = table.Column(type: "INTEGER", nullable: false),
+ Title = table.Column(type: "TEXT", nullable: true),
+ Overview = table.Column(type: "TEXT", nullable: true),
+ StartDate = table.Column(type: "TEXT", nullable: true),
+ EndDate = table.Column(type: "TEXT", nullable: true),
+ Images = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Seasons", x => x.ID);
+ table.ForeignKey(
+ name: "FK_Seasons_Shows_ShowID",
+ column: x => x.ShowID,
+ principalTable: "Shows",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "ShowMetadataID",
+ columns: table => new
+ {
+ ResourceID = table.Column(type: "INTEGER", nullable: false),
+ ProviderID = table.Column(type: "INTEGER", nullable: false),
+ DataID = table.Column(type: "TEXT", nullable: true),
+ Link = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_ShowMetadataID", x => new { x.ResourceID, x.ProviderID });
+ table.ForeignKey(
+ name: "FK_ShowMetadataID_Providers_ProviderID",
+ column: x => x.ProviderID,
+ principalTable: "Providers",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_ShowMetadataID_Shows_ResourceID",
+ column: x => x.ResourceID,
+ principalTable: "Shows",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Episodes",
+ columns: table => new
+ {
+ ID = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Slug = table.Column(type: "TEXT", nullable: true),
+ ShowID = table.Column(type: "INTEGER", nullable: false),
+ SeasonID = table.Column(type: "INTEGER", nullable: true),
+ SeasonNumber = table.Column(type: "INTEGER", nullable: true),
+ EpisodeNumber = table.Column(type: "INTEGER", nullable: true),
+ AbsoluteNumber = table.Column(type: "INTEGER", nullable: true),
+ Path = table.Column(type: "TEXT", nullable: true),
+ Images = table.Column(type: "TEXT", nullable: true),
+ Title = table.Column(type: "TEXT", nullable: true),
+ Overview = table.Column(type: "TEXT", nullable: true),
+ ReleaseDate = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Episodes", x => x.ID);
+ table.ForeignKey(
+ name: "FK_Episodes_Seasons_SeasonID",
+ column: x => x.SeasonID,
+ principalTable: "Seasons",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_Episodes_Shows_ShowID",
+ column: x => x.ShowID,
+ principalTable: "Shows",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "SeasonMetadataID",
+ columns: table => new
+ {
+ ResourceID = table.Column(type: "INTEGER", nullable: false),
+ ProviderID = table.Column(type: "INTEGER", nullable: false),
+ DataID = table.Column(type: "TEXT", nullable: true),
+ Link = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_SeasonMetadataID", x => new { x.ResourceID, x.ProviderID });
+ table.ForeignKey(
+ name: "FK_SeasonMetadataID_Providers_ProviderID",
+ column: x => x.ProviderID,
+ principalTable: "Providers",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_SeasonMetadataID_Seasons_ResourceID",
+ column: x => x.ResourceID,
+ principalTable: "Seasons",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "EpisodeMetadataID",
+ columns: table => new
+ {
+ ResourceID = table.Column(type: "INTEGER", nullable: false),
+ ProviderID = table.Column(type: "INTEGER", nullable: false),
+ DataID = table.Column(type: "TEXT", nullable: true),
+ Link = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_EpisodeMetadataID", x => new { x.ResourceID, x.ProviderID });
+ table.ForeignKey(
+ name: "FK_EpisodeMetadataID_Episodes_ResourceID",
+ column: x => x.ResourceID,
+ principalTable: "Episodes",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_EpisodeMetadataID_Providers_ProviderID",
+ column: x => x.ProviderID,
+ principalTable: "Providers",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Tracks",
+ columns: table => new
+ {
+ ID = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Slug = table.Column(type: "TEXT", nullable: true),
+ Title = table.Column(type: "TEXT", nullable: true),
+ Language = table.Column(type: "TEXT", nullable: true),
+ Codec = table.Column(type: "TEXT", nullable: true),
+ IsDefault = table.Column(type: "INTEGER", nullable: false),
+ IsForced = table.Column(type: "INTEGER", nullable: false),
+ IsExternal = table.Column(type: "INTEGER", nullable: false),
+ Path = table.Column(type: "TEXT", nullable: true),
+ Type = table.Column(type: "INTEGER", nullable: false),
+ EpisodeID = table.Column(type: "INTEGER", nullable: false),
+ TrackIndex = table.Column(type: "INTEGER", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Tracks", x => x.ID);
+ table.ForeignKey(
+ name: "FK_Tracks_Episodes_EpisodeID",
+ column: x => x.EpisodeID,
+ principalTable: "Episodes",
+ principalColumn: "ID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "WatchedEpisodes",
+ columns: table => new
+ {
+ UserID = table.Column(type: "INTEGER", nullable: false),
+ EpisodeID = table.Column(type: "INTEGER", nullable: false),
+ WatchedPercentage = table.Column