summaryrefslogtreecommitdiff
path: root/RemoveMediaTag.cs
blob: d41980d1e9e7b4da4d389a230f8175809c97329c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using HyperBooru.ApiClient;
using System.Management.Automation;

namespace HyperBooru.PowerShell;

[Alias("rhbmt")]
[Cmdlet(VerbsCommon.Remove, "HyperBooruMediaTag")]
public class RemoveMediaTagCmdlet : 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.DeleteTagsAsync(MediaId, TagId)
            .GetAwaiter()
            .GetResult();
}