diff options
| author | Jake Mannens <jake@asger.xyz> | 2026-06-25 12:33:03 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2026-06-25 12:33:03 +1000 |
| commit | b574c5f4831f7fe8b599336c6bd8eb8a0a5e46ce (patch) | |
| tree | 48dab80f8a064d074431df333f5cf9ca31b1957f | |
| parent | 2aa80a043b7d45d3eacf7cd855cdd2f734e9c15e (diff) | |
| -rw-r--r-- | GetMedia.cs | 14 | ||||
| -rw-r--r-- | HyperBooru.psd1 | 2 | ||||
| -rw-r--r-- | PowerShell.csproj | 2 |
3 files changed, 15 insertions, 3 deletions
diff --git a/GetMedia.cs b/GetMedia.cs index e45ae3a..479c783 100644 --- a/GetMedia.cs +++ b/GetMedia.cs @@ -22,8 +22,11 @@ public class GetMediaCmdlet : SessionCmdlet { public Guid TagId { get; set; } [Parameter(ParameterSetName = "Query", Mandatory = true)] public string Query { get; set; } + [Parameter(ParameterSetName = "Checksum", Mandatory = true)] + public string Checksum { get; set; } protected override void ProcessRecord() { + Guid[] mediaIds; FeedRequest feedRequest; switch(ParameterSetName) { @@ -47,6 +50,15 @@ public class GetMediaCmdlet : SessionCmdlet { Query = Query }; break; + case "Checksum": + mediaIds = Session.Media.GetByChecksumAsync(Checksum) + .GetAwaiter() + .GetResult() + .Select(m => m.MediaId) + .ToArray(); + foreach(var m in mediaIds) + WriteObject(m); + return; default: feedRequest = new FeedRequest { SelectIngest = SelectIngest, @@ -58,7 +70,7 @@ public class GetMediaCmdlet : SessionCmdlet { break; } - var mediaIds = Session.Feed.LoadChunkAsync(feedRequest) + mediaIds = Session.Feed.LoadChunkAsync(feedRequest) .GetAwaiter() .GetResult(); diff --git a/HyperBooru.psd1 b/HyperBooru.psd1 index e4ed55e..4d06e65 100644 --- a/HyperBooru.psd1 +++ b/HyperBooru.psd1 @@ -1,6 +1,6 @@ @{ RootModule = 'HyperBooru.PowerShell.dll' - ModuleVersion = '0.19' + ModuleVersion = '0.20' CompatiblePSEditions = 'Core' PowershellVersion = '5.1' GUID = '627c3cbf-7fcc-41b3-9716-610b81ef1032' diff --git a/PowerShell.csproj b/PowerShell.csproj index f3650a4..e55a1a6 100644 --- a/PowerShell.csproj +++ b/PowerShell.csproj @@ -9,7 +9,7 @@ <FileVersion>$(AssemblyVersion)</FileVersion>
<AssemblyTitle>HyperBooru.PowerShell</AssemblyTitle>
<Authors>Jake Mannens</Authors>
- <Version>0.19-alpha</Version>
+ <Version>0.20-alpha</Version>
</PropertyGroup>
<ItemGroup>
|
