aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/JellyfinDb.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-12-03 13:51:12 -0700
committercrobibero <cody@robibe.ro>2020-12-03 13:51:12 -0700
commitb0c79edd2c25f560208a40aedea05498d48ca80e (patch)
tree4052b66cf1234c7d71bc122a96f93382e2eee566 /Jellyfin.Server.Implementations/JellyfinDb.cs
parent4a3411cad17c95f3afe0870a1ff3a9afc10286fa (diff)
Add support for custom item display preferences
Diffstat (limited to 'Jellyfin.Server.Implementations/JellyfinDb.cs')
-rw-r--r--Jellyfin.Server.Implementations/JellyfinDb.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/JellyfinDb.cs b/Jellyfin.Server.Implementations/JellyfinDb.cs
index bf8818f8d..a8aa9b319 100644
--- a/Jellyfin.Server.Implementations/JellyfinDb.cs
+++ b/Jellyfin.Server.Implementations/JellyfinDb.cs
@@ -34,6 +34,8 @@ namespace Jellyfin.Server.Implementations
public virtual DbSet<ItemDisplayPreferences> ItemDisplayPreferences { get; set; }
+ public virtual DbSet<CustomItemDisplayPreferences> CustomItemDisplayPreferences { get; set; }
+
public virtual DbSet<Permission> Permissions { get; set; }
public virtual DbSet<Preference> Preferences { get; set; }
@@ -153,6 +155,14 @@ namespace Jellyfin.Server.Implementations
modelBuilder.Entity<DisplayPreferences>()
.HasIndex(entity => new { entity.UserId, entity.Client })
.IsUnique();
+
+ modelBuilder.Entity<CustomItemDisplayPreferences>()
+ .HasIndex(entity => entity.UserId)
+ .IsUnique(false);
+
+ modelBuilder.Entity<CustomItemDisplayPreferences>()
+ .HasIndex(entity => new { entity.UserId, entity.Client, entity.Key })
+ .IsUnique();
}
}
}