summaryrefslogtreecommitdiff
path: root/HBContext.cs
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2023-08-28 15:45:21 +1000
committerJake Mannens <jake@asger.xyz>2023-08-28 15:45:21 +1000
commit3be6ef65f4ecdfc564231b9e613b8a307dfdbe64 (patch)
treee7608e3d477073be45d76677ad5f0b2509e423c1 /HBContext.cs
parentb8abec12a28f07e898b9ad38575fc1765188c286 (diff)
Gallery media is now filtered by tag using Object IDs rather than Guids, signficantly reducing DB overhead
Diffstat (limited to 'HBContext.cs')
-rw-r--r--HBContext.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/HBContext.cs b/HBContext.cs
index d0cd26f..f6bc15c 100644
--- a/HBContext.cs
+++ b/HBContext.cs
@@ -4,6 +4,9 @@ using HyperBooru.Services;
namespace HyperBooru;
public class HBContext : DbContext {
+ public const int NsfwTagId = -1;
+ public const int IngestTagId = -2;
+
public static readonly Guid NsfwTag = new("EBDAD4F8-455A-4351-8017-1D4854D6FA38");
public static readonly Guid IngestTag = new("EA212801-5BCC-4C0E-814F-FB9D30DB58BC");
@@ -38,13 +41,13 @@ public class HBContext : DbContext {
// These should NEVER change
modelBuilder.Entity<TagDefinition>().HasData(new TagDefinition[] {
new() {
- ObjectId = -1,
+ ObjectId = NsfwTagId,
Guid = NsfwTag,
Source = TagSource.Internal,
Name = "nsfw"
},
new() {
- ObjectId = -2,
+ ObjectId = IngestTagId,
Guid = IngestTag,
Source = TagSource.Internal,
Name = "ingest"