u
This commit is contained in:
@@ -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',
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user