mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Fix typo in comment and remove useless ones
This commit is contained in:
parent
154b7d8505
commit
e5980f8686
@ -155,7 +155,7 @@ namespace Jellyfin.Server.Implementations
|
|||||||
base.OnModelCreating(modelBuilder);
|
base.OnModelCreating(modelBuilder);
|
||||||
modelBuilder.HasDefaultSchema("jellyfin");
|
modelBuilder.HasDefaultSchema("jellyfin");
|
||||||
|
|
||||||
// Configuration for each entity is in it's own class inside 'ModelConfiguratio'.
|
// Configuration for each entity is in it's own class inside 'ModelConfiguration'.
|
||||||
modelBuilder.ApplyConfigurationsFromAssembly(typeof(JellyfinDb).Assembly);
|
modelBuilder.ApplyConfigurationsFromAssembly(typeof(JellyfinDb).Assembly);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,6 @@ namespace Jellyfin.Server.Implementations.ModelConfiguration
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public void Configure(EntityTypeBuilder<ApiKey> builder)
|
public void Configure(EntityTypeBuilder<ApiKey> builder)
|
||||||
{
|
{
|
||||||
// Indexes
|
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.HasIndex(entity => entity.AccessToken)
|
.HasIndex(entity => entity.AccessToken)
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
@ -12,8 +12,6 @@ namespace Jellyfin.Server.Implementations.ModelConfiguration
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public void Configure(EntityTypeBuilder<CustomItemDisplayPreferences> builder)
|
public void Configure(EntityTypeBuilder<CustomItemDisplayPreferences> builder)
|
||||||
{
|
{
|
||||||
// Indexes
|
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client, entity.Key })
|
.HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client, entity.Key })
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
@ -12,8 +12,6 @@ namespace Jellyfin.Server.Implementations.ModelConfiguration
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public void Configure(EntityTypeBuilder<Device> builder)
|
public void Configure(EntityTypeBuilder<Device> builder)
|
||||||
{
|
{
|
||||||
// Indexes
|
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.HasIndex(entity => new { entity.DeviceId, entity.DateLastActivity });
|
.HasIndex(entity => new { entity.DeviceId, entity.DateLastActivity });
|
||||||
|
|
||||||
|
@ -12,8 +12,6 @@ namespace Jellyfin.Server.Implementations.ModelConfiguration
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public void Configure(EntityTypeBuilder<DeviceOptions> builder)
|
public void Configure(EntityTypeBuilder<DeviceOptions> builder)
|
||||||
{
|
{
|
||||||
// Indexes
|
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.HasIndex(entity => entity.DeviceId)
|
.HasIndex(entity => entity.DeviceId)
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
@ -12,15 +12,11 @@ namespace Jellyfin.Server.Implementations.ModelConfiguration
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public void Configure(EntityTypeBuilder<DisplayPreferences> builder)
|
public void Configure(EntityTypeBuilder<DisplayPreferences> builder)
|
||||||
{
|
{
|
||||||
// Delete behaviour
|
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.HasMany(d => d.HomeSections)
|
.HasMany(d => d.HomeSections)
|
||||||
.WithOne()
|
.WithOne()
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
// Indexes
|
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client })
|
.HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client })
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
@ -12,8 +12,6 @@ namespace Jellyfin.Server.Implementations.ModelConfiguration
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public void Configure(EntityTypeBuilder<Permission> builder)
|
public void Configure(EntityTypeBuilder<Permission> builder)
|
||||||
{
|
{
|
||||||
// Indexes
|
|
||||||
|
|
||||||
// Used to get a user's permissions or a specific permission for a user.
|
// Used to get a user's permissions or a specific permission for a user.
|
||||||
// Also prevents multiple values being created for a user.
|
// Also prevents multiple values being created for a user.
|
||||||
// Filtered over non-null user ids for when other entities (groups, API keys) get permissions
|
// Filtered over non-null user ids for when other entities (groups, API keys) get permissions
|
||||||
|
@ -12,8 +12,6 @@ namespace Jellyfin.Server.Implementations.ModelConfiguration
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public void Configure(EntityTypeBuilder<Preference> builder)
|
public void Configure(EntityTypeBuilder<Preference> builder)
|
||||||
{
|
{
|
||||||
// Indexes
|
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.HasIndex(p => new { p.UserId, p.Kind })
|
.HasIndex(p => new { p.UserId, p.Kind })
|
||||||
.HasFilter("[UserId] IS NOT NULL")
|
.HasFilter("[UserId] IS NOT NULL")
|
||||||
|
@ -12,14 +12,10 @@ namespace Jellyfin.Server.Implementations.ModelConfiguration
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public void Configure(EntityTypeBuilder<User> builder)
|
public void Configure(EntityTypeBuilder<User> builder)
|
||||||
{
|
{
|
||||||
// Collations
|
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.Property(user => user.Username)
|
.Property(user => user.Username)
|
||||||
.UseCollation("NOCASE");
|
.UseCollation("NOCASE");
|
||||||
|
|
||||||
// Delete behavior
|
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.HasOne(u => u.ProfileImage)
|
.HasOne(u => u.ProfileImage)
|
||||||
.WithOne()
|
.WithOne()
|
||||||
@ -52,8 +48,6 @@ namespace Jellyfin.Server.Implementations.ModelConfiguration
|
|||||||
.WithOne()
|
.WithOne()
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
// Indexes
|
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.HasIndex(entity => entity.Username)
|
.HasIndex(entity => entity.Username)
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user