This commit is contained in:
seb
2026-08-01 01:59:05 +02:00
parent a05a4791d6
commit 59c874144b
6 changed files with 36 additions and 25 deletions

View File

@@ -133,12 +133,12 @@ const MENU = {
{
value: 'pic.getImageByHash',
label: 'getImageByHash',
hint: 'googleAuthId, hash → meta',
hint: 'googleAuthId, fullHash → meta',
},
{
value: 'pic.getThumbByHash',
label: 'getThumbByHash',
hint: 'googleAuthId, hash → meta',
hint: 'googleAuthId, fullHash → meta',
},
],
},
@@ -461,11 +461,14 @@ async function runMethod(client, action) {
case 'pic.getImageByHash': {
const googleAuthId = await askInt('google_auth id');
if (googleAuthId == null) return;
const hash = await askText('hash (SHA-256 hex)', {
const fullHash = await askText('fullHash (SHA-256 hex)', {
validate: (v) => (!v?.trim() ? 'Required' : undefined),
});
if (hash == null) return;
const image = await client.pic.getImageByHash(Number(googleAuthId), hash.trim());
if (fullHash == null) return;
const image = await client.pic.getImageByHash(
Number(googleAuthId),
fullHash.trim(),
);
return [
'result',
{
@@ -480,11 +483,14 @@ async function runMethod(client, action) {
case 'pic.getThumbByHash': {
const googleAuthId = await askInt('google_auth id');
if (googleAuthId == null) return;
const hash = await askText('hash (SHA-256 hex)', {
const fullHash = await askText('fullHash (SHA-256 hex)', {
validate: (v) => (!v?.trim() ? 'Required' : undefined),
});
if (hash == null) return;
const image = await client.pic.getThumbByHash(Number(googleAuthId), hash.trim());
if (fullHash == null) return;
const image = await client.pic.getThumbByHash(
Number(googleAuthId),
fullHash.trim(),
);
return [
'result',
{