Browse Source

optimize jellyfin database fields and indexes (#2746)

* optimize jellyfin database fields and indexes

* copy paste
pull/2682/merge
Jason Dove 24 hours ago committed by GitHub
parent
commit
14d2dd0c3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 6923
      ErsatzTV.Infrastructure.MySql/Migrations/20251231201959_Optimize_JellyfinItemIdEtagColumns.Designer.cs
  3. 358
      ErsatzTV.Infrastructure.MySql/Migrations/20251231201959_Optimize_JellyfinItemIdEtagColumns.cs
  4. 56
      ErsatzTV.Infrastructure.MySql/Migrations/TvContextModelSnapshot.cs
  5. 6750
      ErsatzTV.Infrastructure.Sqlite/Migrations/20251231201920_Optimize_JellyfinItemIdEtagColumns.Designer.cs
  6. 72
      ErsatzTV.Infrastructure.Sqlite/Migrations/20251231201920_Optimize_JellyfinItemIdEtagColumns.cs
  7. 34
      ErsatzTV.Infrastructure.Sqlite/Migrations/TvContextModelSnapshot.cs
  8. 15
      ErsatzTV.Infrastructure/Data/Configurations/Collection/JellyfinCollectionConfiguration.cs
  9. 6
      ErsatzTV.Infrastructure/Data/Configurations/Library/JellyfinLibraryConfiguration.cs
  10. 15
      ErsatzTV.Infrastructure/Data/Configurations/MediaItem/JellyfinEpisodeConfiguration.cs
  11. 15
      ErsatzTV.Infrastructure/Data/Configurations/MediaItem/JellyfinMovieConfiguration.cs
  12. 15
      ErsatzTV.Infrastructure/Data/Configurations/MediaItem/JellyfinSeasonConfiguration.cs
  13. 15
      ErsatzTV.Infrastructure/Data/Configurations/MediaItem/JellyfinShowConfiguration.cs

1
CHANGELOG.md

@ -80,6 +80,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Items may still be cut as needed - Items may still be cut as needed
- Hardware acceleration will now be used - Hardware acceleration will now be used
- Items can "work ahead" (transcode faster than realtime) when less than 3 minutes in duration - Items can "work ahead" (transcode faster than realtime) when less than 3 minutes in duration
- Optimize Jellyfin database fields and indexes
## [25.9.0] - 2025-11-29 ## [25.9.0] - 2025-11-29
### Added ### Added

6923
ErsatzTV.Infrastructure.MySql/Migrations/20251231201959_Optimize_JellyfinItemIdEtagColumns.Designer.cs generated

File diff suppressed because it is too large Load Diff

358
ErsatzTV.Infrastructure.MySql/Migrations/20251231201959_Optimize_JellyfinItemIdEtagColumns.cs

@ -0,0 +1,358 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.MySql.Migrations
{
/// <inheritdoc />
public partial class Optimize_JellyfinItemIdEtagColumns : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ItemId",
table: "JellyfinShow",
type: "varchar(36)",
unicode: false,
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Etag",
table: "JellyfinShow",
type: "varchar(36)",
unicode: false,
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ItemId",
table: "JellyfinSeason",
type: "varchar(36)",
unicode: false,
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Etag",
table: "JellyfinSeason",
type: "varchar(36)",
unicode: false,
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ItemId",
table: "JellyfinMovie",
type: "varchar(36)",
unicode: false,
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Etag",
table: "JellyfinMovie",
type: "varchar(36)",
unicode: false,
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ItemId",
table: "JellyfinLibrary",
type: "varchar(36)",
unicode: false,
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ItemId",
table: "JellyfinEpisode",
type: "varchar(36)",
unicode: false,
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Etag",
table: "JellyfinEpisode",
type: "varchar(36)",
unicode: false,
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ItemId",
table: "JellyfinCollection",
type: "varchar(36)",
unicode: false,
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Etag",
table: "JellyfinCollection",
type: "varchar(36)",
unicode: false,
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_JellyfinShow_ItemId",
table: "JellyfinShow",
column: "ItemId");
migrationBuilder.CreateIndex(
name: "IX_JellyfinSeason_ItemId",
table: "JellyfinSeason",
column: "ItemId");
migrationBuilder.CreateIndex(
name: "IX_JellyfinMovie_ItemId",
table: "JellyfinMovie",
column: "ItemId");
migrationBuilder.CreateIndex(
name: "IX_JellyfinLibrary_ItemId",
table: "JellyfinLibrary",
column: "ItemId");
migrationBuilder.CreateIndex(
name: "IX_JellyfinEpisode_ItemId",
table: "JellyfinEpisode",
column: "ItemId");
migrationBuilder.CreateIndex(
name: "IX_JellyfinCollection_ItemId",
table: "JellyfinCollection",
column: "ItemId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_JellyfinShow_ItemId",
table: "JellyfinShow");
migrationBuilder.DropIndex(
name: "IX_JellyfinSeason_ItemId",
table: "JellyfinSeason");
migrationBuilder.DropIndex(
name: "IX_JellyfinMovie_ItemId",
table: "JellyfinMovie");
migrationBuilder.DropIndex(
name: "IX_JellyfinLibrary_ItemId",
table: "JellyfinLibrary");
migrationBuilder.DropIndex(
name: "IX_JellyfinEpisode_ItemId",
table: "JellyfinEpisode");
migrationBuilder.DropIndex(
name: "IX_JellyfinCollection_ItemId",
table: "JellyfinCollection");
migrationBuilder.AlterColumn<string>(
name: "ItemId",
table: "JellyfinShow",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(36)",
oldUnicode: false,
oldMaxLength: 36,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Etag",
table: "JellyfinShow",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(36)",
oldUnicode: false,
oldMaxLength: 36,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ItemId",
table: "JellyfinSeason",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(36)",
oldUnicode: false,
oldMaxLength: 36,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Etag",
table: "JellyfinSeason",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(36)",
oldUnicode: false,
oldMaxLength: 36,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ItemId",
table: "JellyfinMovie",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(36)",
oldUnicode: false,
oldMaxLength: 36,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Etag",
table: "JellyfinMovie",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(36)",
oldUnicode: false,
oldMaxLength: 36,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ItemId",
table: "JellyfinLibrary",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(36)",
oldUnicode: false,
oldMaxLength: 36,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ItemId",
table: "JellyfinEpisode",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(36)",
oldUnicode: false,
oldMaxLength: 36,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Etag",
table: "JellyfinEpisode",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(36)",
oldUnicode: false,
oldMaxLength: 36,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ItemId",
table: "JellyfinCollection",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(36)",
oldUnicode: false,
oldMaxLength: 36,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Etag",
table: "JellyfinCollection",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(36)",
oldUnicode: false,
oldMaxLength: 36,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}

56
ErsatzTV.Infrastructure.MySql/Migrations/TvContextModelSnapshot.cs

@ -1024,16 +1024,22 @@ namespace ErsatzTV.Infrastructure.MySql.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id")); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Etag") b.Property<string>("Etag")
.HasColumnType("longtext"); .HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("varchar(36)");
b.Property<string>("ItemId") b.Property<string>("ItemId")
.HasColumnType("longtext"); .HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("varchar(36)");
b.Property<string>("Name") b.Property<string>("Name")
.HasColumnType("longtext"); .HasColumnType("longtext");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ItemId");
b.ToTable("JellyfinCollection", (string)null); b.ToTable("JellyfinCollection", (string)null);
}); });
@ -3781,11 +3787,15 @@ namespace ErsatzTV.Infrastructure.MySql.Migrations
b.HasBaseType("ErsatzTV.Core.Domain.Library"); b.HasBaseType("ErsatzTV.Core.Domain.Library");
b.Property<string>("ItemId") b.Property<string>("ItemId")
.HasColumnType("longtext"); .HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("varchar(36)");
b.Property<bool>("ShouldSyncItems") b.Property<bool>("ShouldSyncItems")
.HasColumnType("tinyint(1)"); .HasColumnType("tinyint(1)");
b.HasIndex("ItemId");
b.ToTable("JellyfinLibrary", (string)null); b.ToTable("JellyfinLibrary", (string)null);
}); });
@ -4053,10 +4063,16 @@ namespace ErsatzTV.Infrastructure.MySql.Migrations
b.HasBaseType("ErsatzTV.Core.Domain.Episode"); b.HasBaseType("ErsatzTV.Core.Domain.Episode");
b.Property<string>("Etag") b.Property<string>("Etag")
.HasColumnType("longtext"); .HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("varchar(36)");
b.Property<string>("ItemId") b.Property<string>("ItemId")
.HasColumnType("longtext"); .HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("varchar(36)");
b.HasIndex("ItemId");
b.ToTable("JellyfinEpisode", (string)null); b.ToTable("JellyfinEpisode", (string)null);
}); });
@ -4092,10 +4108,16 @@ namespace ErsatzTV.Infrastructure.MySql.Migrations
b.HasBaseType("ErsatzTV.Core.Domain.Movie"); b.HasBaseType("ErsatzTV.Core.Domain.Movie");
b.Property<string>("Etag") b.Property<string>("Etag")
.HasColumnType("longtext"); .HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("varchar(36)");
b.Property<string>("ItemId") b.Property<string>("ItemId")
.HasColumnType("longtext"); .HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("varchar(36)");
b.HasIndex("ItemId");
b.ToTable("JellyfinMovie", (string)null); b.ToTable("JellyfinMovie", (string)null);
}); });
@ -4144,10 +4166,16 @@ namespace ErsatzTV.Infrastructure.MySql.Migrations
b.HasBaseType("ErsatzTV.Core.Domain.Season"); b.HasBaseType("ErsatzTV.Core.Domain.Season");
b.Property<string>("Etag") b.Property<string>("Etag")
.HasColumnType("longtext"); .HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("varchar(36)");
b.Property<string>("ItemId") b.Property<string>("ItemId")
.HasColumnType("longtext"); .HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("varchar(36)");
b.HasIndex("ItemId");
b.ToTable("JellyfinSeason", (string)null); b.ToTable("JellyfinSeason", (string)null);
}); });
@ -4183,10 +4211,16 @@ namespace ErsatzTV.Infrastructure.MySql.Migrations
b.HasBaseType("ErsatzTV.Core.Domain.Show"); b.HasBaseType("ErsatzTV.Core.Domain.Show");
b.Property<string>("Etag") b.Property<string>("Etag")
.HasColumnType("longtext"); .HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("varchar(36)");
b.Property<string>("ItemId") b.Property<string>("ItemId")
.HasColumnType("longtext"); .HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("varchar(36)");
b.HasIndex("ItemId");
b.ToTable("JellyfinShow", (string)null); b.ToTable("JellyfinShow", (string)null);
}); });

6750
ErsatzTV.Infrastructure.Sqlite/Migrations/20251231201920_Optimize_JellyfinItemIdEtagColumns.Designer.cs generated

File diff suppressed because it is too large Load Diff

72
ErsatzTV.Infrastructure.Sqlite/Migrations/20251231201920_Optimize_JellyfinItemIdEtagColumns.cs

@ -0,0 +1,72 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.Sqlite.Migrations
{
/// <inheritdoc />
public partial class Optimize_JellyfinItemIdEtagColumns : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_JellyfinShow_ItemId",
table: "JellyfinShow",
column: "ItemId");
migrationBuilder.CreateIndex(
name: "IX_JellyfinSeason_ItemId",
table: "JellyfinSeason",
column: "ItemId");
migrationBuilder.CreateIndex(
name: "IX_JellyfinMovie_ItemId",
table: "JellyfinMovie",
column: "ItemId");
migrationBuilder.CreateIndex(
name: "IX_JellyfinLibrary_ItemId",
table: "JellyfinLibrary",
column: "ItemId");
migrationBuilder.CreateIndex(
name: "IX_JellyfinEpisode_ItemId",
table: "JellyfinEpisode",
column: "ItemId");
migrationBuilder.CreateIndex(
name: "IX_JellyfinCollection_ItemId",
table: "JellyfinCollection",
column: "ItemId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_JellyfinShow_ItemId",
table: "JellyfinShow");
migrationBuilder.DropIndex(
name: "IX_JellyfinSeason_ItemId",
table: "JellyfinSeason");
migrationBuilder.DropIndex(
name: "IX_JellyfinMovie_ItemId",
table: "JellyfinMovie");
migrationBuilder.DropIndex(
name: "IX_JellyfinLibrary_ItemId",
table: "JellyfinLibrary");
migrationBuilder.DropIndex(
name: "IX_JellyfinEpisode_ItemId",
table: "JellyfinEpisode");
migrationBuilder.DropIndex(
name: "IX_JellyfinCollection_ItemId",
table: "JellyfinCollection");
}
}
}

34
ErsatzTV.Infrastructure.Sqlite/Migrations/TvContextModelSnapshot.cs

@ -981,9 +981,13 @@ namespace ErsatzTV.Infrastructure.Sqlite.Migrations
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.Property<string>("Etag") b.Property<string>("Etag")
.HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("ItemId") b.Property<string>("ItemId")
.HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Name") b.Property<string>("Name")
@ -991,6 +995,8 @@ namespace ErsatzTV.Infrastructure.Sqlite.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ItemId");
b.ToTable("JellyfinCollection", (string)null); b.ToTable("JellyfinCollection", (string)null);
}); });
@ -3608,11 +3614,15 @@ namespace ErsatzTV.Infrastructure.Sqlite.Migrations
b.HasBaseType("ErsatzTV.Core.Domain.Library"); b.HasBaseType("ErsatzTV.Core.Domain.Library");
b.Property<string>("ItemId") b.Property<string>("ItemId")
.HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<bool>("ShouldSyncItems") b.Property<bool>("ShouldSyncItems")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.HasIndex("ItemId");
b.ToTable("JellyfinLibrary", (string)null); b.ToTable("JellyfinLibrary", (string)null);
}); });
@ -3880,11 +3890,17 @@ namespace ErsatzTV.Infrastructure.Sqlite.Migrations
b.HasBaseType("ErsatzTV.Core.Domain.Episode"); b.HasBaseType("ErsatzTV.Core.Domain.Episode");
b.Property<string>("Etag") b.Property<string>("Etag")
.HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("ItemId") b.Property<string>("ItemId")
.HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.HasIndex("ItemId");
b.ToTable("JellyfinEpisode", (string)null); b.ToTable("JellyfinEpisode", (string)null);
}); });
@ -3919,11 +3935,17 @@ namespace ErsatzTV.Infrastructure.Sqlite.Migrations
b.HasBaseType("ErsatzTV.Core.Domain.Movie"); b.HasBaseType("ErsatzTV.Core.Domain.Movie");
b.Property<string>("Etag") b.Property<string>("Etag")
.HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("ItemId") b.Property<string>("ItemId")
.HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.HasIndex("ItemId");
b.ToTable("JellyfinMovie", (string)null); b.ToTable("JellyfinMovie", (string)null);
}); });
@ -3971,11 +3993,17 @@ namespace ErsatzTV.Infrastructure.Sqlite.Migrations
b.HasBaseType("ErsatzTV.Core.Domain.Season"); b.HasBaseType("ErsatzTV.Core.Domain.Season");
b.Property<string>("Etag") b.Property<string>("Etag")
.HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("ItemId") b.Property<string>("ItemId")
.HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.HasIndex("ItemId");
b.ToTable("JellyfinSeason", (string)null); b.ToTable("JellyfinSeason", (string)null);
}); });
@ -4010,11 +4038,17 @@ namespace ErsatzTV.Infrastructure.Sqlite.Migrations
b.HasBaseType("ErsatzTV.Core.Domain.Show"); b.HasBaseType("ErsatzTV.Core.Domain.Show");
b.Property<string>("Etag") b.Property<string>("Etag")
.HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("ItemId") b.Property<string>("ItemId")
.HasMaxLength(36)
.IsUnicode(false)
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.HasIndex("ItemId");
b.ToTable("JellyfinShow", (string)null); b.ToTable("JellyfinShow", (string)null);
}); });

15
ErsatzTV.Infrastructure/Data/Configurations/Collection/JellyfinCollectionConfiguration.cs

@ -6,5 +6,18 @@ namespace ErsatzTV.Infrastructure.Data.Configurations;
public class JellyfinCollectionConfiguration : IEntityTypeConfiguration<JellyfinCollection> public class JellyfinCollectionConfiguration : IEntityTypeConfiguration<JellyfinCollection>
{ {
public void Configure(EntityTypeBuilder<JellyfinCollection> builder) => builder.ToTable("JellyfinCollection"); public void Configure(EntityTypeBuilder<JellyfinCollection> builder)
{
builder.ToTable("JellyfinCollection");
builder.Property(c => c.Etag)
.HasMaxLength(36)
.IsUnicode(false);
builder.Property(c => c.ItemId)
.HasMaxLength(36)
.IsUnicode(false);
builder.HasIndex(c => c.ItemId);
}
} }

6
ErsatzTV.Infrastructure/Data/Configurations/Library/JellyfinLibraryConfiguration.cs

@ -13,5 +13,11 @@ public class JellyfinLibraryConfiguration : IEntityTypeConfiguration<JellyfinLib
builder.HasMany(l => l.PathInfos) builder.HasMany(l => l.PathInfos)
.WithOne() .WithOne()
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade);
builder.Property(l => l.ItemId)
.HasMaxLength(36)
.IsUnicode(false);
builder.HasIndex(l => l.ItemId);
} }
} }

15
ErsatzTV.Infrastructure/Data/Configurations/MediaItem/JellyfinEpisodeConfiguration.cs

@ -6,5 +6,18 @@ namespace ErsatzTV.Infrastructure.Data.Configurations;
public class JellyfinEpisodeConfiguration : IEntityTypeConfiguration<JellyfinEpisode> public class JellyfinEpisodeConfiguration : IEntityTypeConfiguration<JellyfinEpisode>
{ {
public void Configure(EntityTypeBuilder<JellyfinEpisode> builder) => builder.ToTable("JellyfinEpisode"); public void Configure(EntityTypeBuilder<JellyfinEpisode> builder)
{
builder.ToTable("JellyfinEpisode");
builder.Property(e => e.Etag)
.HasMaxLength(36)
.IsUnicode(false);
builder.Property(e => e.ItemId)
.HasMaxLength(36)
.IsUnicode(false);
builder.HasIndex(e => e.ItemId);
}
} }

15
ErsatzTV.Infrastructure/Data/Configurations/MediaItem/JellyfinMovieConfiguration.cs

@ -6,5 +6,18 @@ namespace ErsatzTV.Infrastructure.Data.Configurations;
public class JellyfinMovieConfiguration : IEntityTypeConfiguration<JellyfinMovie> public class JellyfinMovieConfiguration : IEntityTypeConfiguration<JellyfinMovie>
{ {
public void Configure(EntityTypeBuilder<JellyfinMovie> builder) => builder.ToTable("JellyfinMovie"); public void Configure(EntityTypeBuilder<JellyfinMovie> builder)
{
builder.ToTable("JellyfinMovie");
builder.Property(m => m.Etag)
.HasMaxLength(36)
.IsUnicode(false);
builder.Property(m => m.ItemId)
.HasMaxLength(36)
.IsUnicode(false);
builder.HasIndex(m => m.ItemId);
}
} }

15
ErsatzTV.Infrastructure/Data/Configurations/MediaItem/JellyfinSeasonConfiguration.cs

@ -6,5 +6,18 @@ namespace ErsatzTV.Infrastructure.Data.Configurations;
public class JellyfinSeasonConfiguration : IEntityTypeConfiguration<JellyfinSeason> public class JellyfinSeasonConfiguration : IEntityTypeConfiguration<JellyfinSeason>
{ {
public void Configure(EntityTypeBuilder<JellyfinSeason> builder) => builder.ToTable("JellyfinSeason"); public void Configure(EntityTypeBuilder<JellyfinSeason> builder)
{
builder.ToTable("JellyfinSeason");
builder.Property(s => s.Etag)
.HasMaxLength(36)
.IsUnicode(false);
builder.Property(s => s.ItemId)
.HasMaxLength(36)
.IsUnicode(false);
builder.HasIndex(s => s.ItemId);
}
} }

15
ErsatzTV.Infrastructure/Data/Configurations/MediaItem/JellyfinShowConfiguration.cs

@ -6,5 +6,18 @@ namespace ErsatzTV.Infrastructure.Data.Configurations;
public class JellyfinShowConfiguration : IEntityTypeConfiguration<JellyfinShow> public class JellyfinShowConfiguration : IEntityTypeConfiguration<JellyfinShow>
{ {
public void Configure(EntityTypeBuilder<JellyfinShow> builder) => builder.ToTable("JellyfinShow"); public void Configure(EntityTypeBuilder<JellyfinShow> builder)
{
builder.ToTable("JellyfinShow");
builder.Property(s => s.Etag)
.HasMaxLength(36)
.IsUnicode(false);
builder.Property(s => s.ItemId)
.HasMaxLength(36)
.IsUnicode(false);
builder.HasIndex(s => s.ItemId);
}
} }

Loading…
Cancel
Save