Scopes books to a media library and tracks their metadata enrichment status

This commit is contained in:
BinaryAlley committed 2026-08-12 11:01:59 -07:00
1 parent 386d583a2b
commit f33817f2d2
48 files changed
+2038 -63

No files matched your search

@@ -130,6 +130,23 @@ public class BookConfiguration : IEntityTypeConfiguration<BookEntity>
.HasColumnOrder(28);
builder.Property(book => book.AppleBooksId)
.HasColumnOrder(29);
builder.Property(book => book.LibraryId)
.IsRequired()
.HasColumnOrder(36);
builder.Property(book => book.Path)
.IsRequired()
.HasMaxLength(2048)
.HasColumnOrder(37);
builder.Property(book => book.MetadataStatus)
.HasConversion<string>()
.HasMaxLength(20)
.IsRequired()
.HasColumnOrder(38);
builder.Property(book => book.LastMetadataUpdateUtc)
.HasColumnOrder(39);
builder.Property(book => book.MetadataProvider)
.HasMaxLength(100)
.HasColumnOrder(40);
builder.Property(book => book.CreatedOnUtc)
.HasColumnOrder(30);
builder.Property(book => book.UpdatedOnUtc)
@@ -219,6 +236,9 @@ public class BookConfiguration : IEntityTypeConfiguration<BookEntity>
builder.Property(book => book.UpdatedBy)
.HasDefaultValue(null)
.HasColumnOrder(35);
builder.HasIndex(book => new { book.LibraryId, book.Path });
builder.HasIndex(book => new { book.LibraryId, book.MetadataStatus });
}
}
@@ -0,0 +1,98 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Lumina.DataAccess.Common.Migrations
{
/// <inheritdoc />
public partial class AddsBookLibraryAndPathAndMetadataStatus : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "LastMetadataUpdateUtc",
table: "Books",
type: "TEXT",
nullable: true)
.Annotation("Relational:ColumnOrder", 39);
migrationBuilder.AddColumn<Guid>(
name: "LibraryId",
table: "Books",
type: "TEXT",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"))
.Annotation("Relational:ColumnOrder", 36);
migrationBuilder.AddColumn<string>(
name: "MetadataProvider",
table: "Books",
type: "TEXT",
maxLength: 100,
nullable: true)
.Annotation("Relational:ColumnOrder", 40);
migrationBuilder.AddColumn<string>(
name: "MetadataStatus",
table: "Books",
type: "TEXT",
maxLength: 20,
nullable: false,
defaultValue: "")
.Annotation("Relational:ColumnOrder", 38);
migrationBuilder.AddColumn<string>(
name: "Path",
table: "Books",
type: "TEXT",
maxLength: 2048,
nullable: false,
defaultValue: "")
.Annotation("Relational:ColumnOrder", 37);
migrationBuilder.CreateIndex(
name: "IX_Books_LibraryId_MetadataStatus",
table: "Books",
columns: new[] { "LibraryId", "MetadataStatus" });
migrationBuilder.CreateIndex(
name: "IX_Books_LibraryId_Path",
table: "Books",
columns: new[] { "LibraryId", "Path" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Books_LibraryId_MetadataStatus",
table: "Books");
migrationBuilder.DropIndex(
name: "IX_Books_LibraryId_Path",
table: "Books");
migrationBuilder.DropColumn(
name: "LastMetadataUpdateUtc",
table: "Books");
migrationBuilder.DropColumn(
name: "LibraryId",
table: "Books");
migrationBuilder.DropColumn(
name: "MetadataProvider",
table: "Books");
migrationBuilder.DropColumn(
name: "MetadataStatus",
table: "Books");
migrationBuilder.DropColumn(
name: "Path",
table: "Books");
}
}
}