From d36e27387eabf88845d364b9d3a2da54a583247f Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Mon, 15 Jun 2026 12:54:44 +1000 Subject: v0.18a --- SetImplicitTag.cs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'SetImplicitTag.cs') 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)}"); + } } -- cgit v1.3