From d36e27387eabf88845d364b9d3a2da54a583247f Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Mon, 15 Jun 2026 12:54:44 +1000 Subject: v0.18a --- AddImplicitTag.cs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'AddImplicitTag.cs') diff --git a/AddImplicitTag.cs b/AddImplicitTag.cs index 50f6cfc..db2d0bf 100644 --- a/AddImplicitTag.cs +++ b/AddImplicitTag.cs @@ -1,17 +1,24 @@ -using HyperBooru.ApiClient; -using System.Management.Automation; +using System.Management.Automation; namespace HyperBooru.PowerShell; [Alias("ahbit")] [Cmdlet(VerbsCommon.Add, "HyperBooruImplicitTag")] -public class AddImplicitTagCmdlet : 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 AddImplicitTagCmdlet : 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.AddImplicitTagsAsync(TagDefinitionId, ImplicitTagId) .GetAwaiter() .GetResult(); + + var id = TagDefinitionId.ToString().ToUpper(); + var impl = ImplicitTagId + .Order() + .Distinct() + .Select(t => t.ToString().ToUpper()); + + WriteVerbose($"Added implicit tags {string.Join(", ", impl)} to tag {id}"); + } } -- cgit v1.3