mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-11 12:46:20 +00:00
WIP move baseitem to jellyfin.db
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Jellyfin.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Jellyfin.Server.Implementations.ModelConfiguration;
|
||||
|
||||
/// <summary>
|
||||
/// AncestorId configuration.
|
||||
/// </summary>
|
||||
public class AncestorIdConfiguration : IEntityTypeConfiguration<AncestorId>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public void Configure(EntityTypeBuilder<AncestorId> builder)
|
||||
{
|
||||
builder.HasKey(e => new { e.ItemId, e.Id });
|
||||
builder.HasIndex(e => e.Id);
|
||||
builder.HasIndex(e => new { e.ItemId, e.AncestorIdText });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using Jellyfin.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Jellyfin.Server.Implementations.ModelConfiguration;
|
||||
|
||||
/// <summary>
|
||||
/// Configuration for BaseItem.
|
||||
/// </summary>
|
||||
public class BaseItemConfiguration : IEntityTypeConfiguration<BaseItem>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public void Configure(EntityTypeBuilder<BaseItem> builder)
|
||||
{
|
||||
builder.HasNoKey();
|
||||
builder.HasIndex(e => e.Path);
|
||||
builder.HasIndex(e => e.ParentId);
|
||||
builder.HasIndex(e => e.PresentationUniqueKey);
|
||||
builder.HasIndex(e => new { e.Id, e.Type, e.IsFolder, e.IsVirtualItem });
|
||||
builder.HasIndex(e => new { e.UserDataKey, e.Type });
|
||||
|
||||
// covering index
|
||||
builder.HasIndex(e => new { e.TopParentId, e.Id });
|
||||
// series
|
||||
builder.HasIndex(e => new { e.Type, e.SeriesPresentationUniqueKey, e.PresentationUniqueKey, e.SortName });
|
||||
// series counts
|
||||
// seriesdateplayed sort order
|
||||
builder.HasIndex(e => new { e.Type, e.SeriesPresentationUniqueKey, e.IsFolder, e.IsVirtualItem });
|
||||
// live tv programs
|
||||
builder.HasIndex(e => new { e.Type, e.TopParentId, e.StartDate });
|
||||
// covering index for getitemvalues
|
||||
builder.HasIndex(e => new { e.Type, e.TopParentId, e.Id });
|
||||
// used by movie suggestions
|
||||
builder.HasIndex(e => new { e.Type, e.TopParentId, e.PresentationUniqueKey });
|
||||
// latest items
|
||||
builder.HasIndex(e => new { e.Type, e.TopParentId, e.IsVirtualItem, e.PresentationUniqueKey, e.DateCreated });
|
||||
builder.HasIndex(e => new { e.IsFolder, e.TopParentId, e.IsVirtualItem, e.PresentationUniqueKey, e.DateCreated });
|
||||
// resume
|
||||
builder.HasIndex(e => new { e.MediaType, e.TopParentId, e.IsVirtualItem, e.PresentationUniqueKey });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Jellyfin.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Jellyfin.Server.Implementations.ModelConfiguration;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Chapter configuration.
|
||||
/// </summary>
|
||||
public class ChapterConfiguration : IEntityTypeConfiguration<Chapter>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public void Configure(EntityTypeBuilder<Chapter> builder)
|
||||
{
|
||||
builder.HasNoKey();
|
||||
builder.HasIndex(e => new { e.ItemId, e.ChapterIndex });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Jellyfin.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Jellyfin.Server.Implementations.ModelConfiguration;
|
||||
|
||||
/// <summary>
|
||||
/// itemvalues Configuration.
|
||||
/// </summary>
|
||||
public class ItemValuesConfiguration : IEntityTypeConfiguration<ItemValue>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public void Configure(EntityTypeBuilder<ItemValue> builder)
|
||||
{
|
||||
builder.HasNoKey();
|
||||
builder.HasIndex(e => new { e.ItemId, e.Type, e.CleanValue });
|
||||
builder.HasIndex(e => new { e.ItemId, e.Type, e.Value });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Jellyfin.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Jellyfin.Server.Implementations.ModelConfiguration;
|
||||
|
||||
/// <summary>
|
||||
/// People configuration.
|
||||
/// </summary>
|
||||
public class PeopleConfiguration : IEntityTypeConfiguration<People>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public void Configure(EntityTypeBuilder<People> builder)
|
||||
{
|
||||
builder.HasNoKey();
|
||||
builder.HasIndex(e => new { e.ItemId, e.ListOrder });
|
||||
builder.HasIndex(e => e.Name);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user