summaryrefslogtreecommitdiff
path: root/SetImplicitTag.cs
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2026-06-15 12:54:44 +1000
committerJake Mannens <jake@asger.xyz>2026-06-15 12:54:44 +1000
commitd36e27387eabf88845d364b9d3a2da54a583247f (patch)
tree716058aac0b72c1ec1bb0b7eb47d4e3a87926299 /SetImplicitTag.cs
parentab46387d4d02e30b171a7c2fa07947b41ec691a0 (diff)
Diffstat (limited to 'SetImplicitTag.cs')
-rw-r--r--SetImplicitTag.cs21
1 files changed, 14 insertions, 7 deletions
diff --git a/SetImplicitTag.cs b/SetImplicitTag.cs
index 8d11f1c..bad10d1 100644
--- a/SetImplicitTag.cs
+++ b/SetImplicitTag.cs
@@ -1,17 +1,24 @@
-using HyperBooru.ApiClient;
-using System.Management.Automation;
+using System.Management.Automation;
namespace HyperBooru.PowerShell;
[Alias("shbit")]
[Cmdlet(VerbsCommon.Set, "HyperBooruImplicitTag")]
-public class SetImplicitTagCmdlet : PSCmdlet {
- [Parameter(Mandatory = true)] public required HBSession Session { get; set; }
- [Parameter(Mandatory = true)] public required Guid TagDefinitionId { get; set; }
- [Parameter(Mandatory = true)] public required Guid[] ImplicitTagId { get; set; }
+public class SetImplicitTagCmdlet : SessionCmdlet {
+ [Parameter(Mandatory = true)] public required Guid TagDefinitionId { get; set; }
+ [Parameter(Mandatory = true)] public required Guid[] ImplicitTagId { get; set; }
- protected override void ProcessRecord() =>
+ protected override void ProcessRecord() {
Session.Tag.ReplaceImplicitTagsAsync(TagDefinitionId, ImplicitTagId)
.GetAwaiter()
.GetResult();
+
+ var id = TagDefinitionId.ToString().ToUpper();
+ var impl = ImplicitTagId
+ .Order()
+ .Distinct()
+ .Select(t => t.ToString().ToUpper());
+
+ WriteVerbose($"Set implicit tags for {id} to {string.Join(", ", impl)}");
+ }
}