summaryrefslogtreecommitdiff
path: root/SetMediaTag.cs
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2026-05-09 02:59:46 +1000
committerJake Mannens <jake@asger.xyz>2026-05-09 02:59:46 +1000
commited0fb341e62a94e3e467a016b955b3808d2b15c4 (patch)
treee86003c0093fd8ff2eb93012c3e1d6f89b5918a6 /SetMediaTag.cs
parent8ef09f9fed656bacc3a25e790796e9f144a5fac8 (diff)
v0.15av0.15a
Diffstat (limited to 'SetMediaTag.cs')
-rw-r--r--SetMediaTag.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/SetMediaTag.cs b/SetMediaTag.cs
new file mode 100644
index 0000000..8931991
--- /dev/null
+++ b/SetMediaTag.cs
@@ -0,0 +1,22 @@
+using HyperBooru.ApiClient;
+using System.Management.Automation;
+
+namespace HyperBooru.PowerShell;
+
+[Alias("shbmt")]
+[Cmdlet(VerbsCommon.Set, "HyperBooruMediaTag")]
+public class SetMediaTagCmdlet : PSCmdlet {
+ [Parameter(Position = 0, Mandatory = true)]
+ public required HBSession Session { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true)]
+ public Guid MediaId { get; set; }
+
+ [Parameter(Position = 2, Mandatory = true)]
+ public Guid[] TagId { get; set; }
+
+ protected override void ProcessRecord() =>
+ Session.Media.ReplaceTagsAsync(MediaId, TagId)
+ .GetAwaiter()
+ .GetResult();
+}