summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HBContext.cs3
-rw-r--r--Pages/Component/MediaTagTable.razor2
-rw-r--r--Pages/Component/TagSelectDialog.razor2
-rw-r--r--Pages/TagDefinitions.razor4
-rw-r--r--Tag.cs9
5 files changed, 9 insertions, 11 deletions
diff --git a/HBContext.cs b/HBContext.cs
index b684a51..766c0a3 100644
--- a/HBContext.cs
+++ b/HBContext.cs
@@ -1,4 +1,5 @@
-using HyperBooru.Services;
+using HyperBooru.ApiModels;
+using HyperBooru.Services;
using Microsoft.EntityFrameworkCore;
namespace HyperBooru;
diff --git a/Pages/Component/MediaTagTable.razor b/Pages/Component/MediaTagTable.razor
index e687529..1b62832 100644
--- a/Pages/Component/MediaTagTable.razor
+++ b/Pages/Component/MediaTagTable.razor
@@ -61,7 +61,7 @@
var media = db.Media.First(m => m.ObjectId == Media.ObjectId);
tagDefs = tagService.GetAllTags(Media)
- .Where(e => e.tagDefinition.Source == TagSource.UserTag)
+ .Where(e => e.tagDefinition.Source == ApiModels.TagSource.UserTag)
.ToArray();
}
diff --git a/Pages/Component/TagSelectDialog.razor b/Pages/Component/TagSelectDialog.razor
index 87065d7..d33b178 100644
--- a/Pages/Component/TagSelectDialog.razor
+++ b/Pages/Component/TagSelectDialog.razor
@@ -97,7 +97,7 @@
tagDefinitions = db.TagDefinitions
.Include(td => td.ImplicitTags)
- .Where(td => td.Source == TagSource.UserTag)
+ .Where(td => td.Source == ApiModels.TagSource.UserTag)
.OrderBy(td => td.Name)
.AsEnumerable()
.Where(td => userService.UserSessionState.ShowNsfw || !td.ImplicitTags
diff --git a/Pages/TagDefinitions.razor b/Pages/TagDefinitions.razor
index f3dca0f..c67a43f 100644
--- a/Pages/TagDefinitions.razor
+++ b/Pages/TagDefinitions.razor
@@ -34,7 +34,7 @@
<i>
@{
var implicitTags = tagDef.ImplicitTags
- .Where(td => td.Source == TagSource.UserTag);
+ .Where(td => td.Source == ApiModels.TagSource.UserTag);
foreach(var tag in implicitTags) {
<a href="/Gallery?q=@tag.Name" class="nondecorated">
@tag.Name
@@ -108,7 +108,7 @@
tagDefinitions = dbFactory.CreateDbContext().TagDefinitions
.Include(td => td.ImplicitTags)
- .Where(td => td.Source == TagSource.UserTag)
+ .Where(td => td.Source == ApiModels.TagSource.UserTag)
.OrderBy(td => td.Namespace)
.ThenBy(td => td.Name)
.AsEnumerable()
diff --git a/Tag.cs b/Tag.cs
index c857c66..7da6232 100644
--- a/Tag.cs
+++ b/Tag.cs
@@ -1,12 +1,8 @@
-using System.ComponentModel.DataAnnotations.Schema;
+using HyperBooru.ApiModels;
+using System.ComponentModel.DataAnnotations.Schema;
namespace HyperBooru;
-public enum TagSource {
- Internal,
- UserTag
-}
-
public class TagDefinition : HBObject {
public TagSource Source { get; set; } = TagSource.Internal;
public string? Namespace { get; set; }
@@ -16,6 +12,7 @@ public class TagDefinition : HBObject {
public static explicit operator ApiModels.TagDefinition(TagDefinition tagDefinition) => new() {
TagDefinitionId = tagDefinition.Guid,
+ Source = tagDefinition.Source,
Namespace = tagDefinition.Namespace,
Name = tagDefinition.Name,
Alias = tagDefinition.Alias,