From 6a5bb6a0f849af908522abe2024088fcc814a063 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Tue, 27 Jan 2026 03:38:13 +0100 Subject: [PATCH] Improved StashDB import tool entity argument handling. --- src/tools/stashdb-hashes.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/tools/stashdb-hashes.js b/src/tools/stashdb-hashes.js index 1e4dd321..91df21e0 100644 --- a/src/tools/stashdb-hashes.js +++ b/src/tools/stashdb-hashes.js @@ -89,10 +89,10 @@ async function curateData(data) { .leftJoin('entities', 'entities.id', 'releases.entity_id') .leftJoin('entities as parents', 'parents.id', 'entities.parent_id') .modify((builder) => { - if (args.channel.charAt(0) === '_') { - builder.where('parents.slug', args.entity.slice(1)); + if (args.network) { + builder.where('parents.slug', args.network); } else { - builder.where('entities.slug', args.entity); + builder.where('entities.slug', args.channel); } }) .whereIn('entry_id', stashScenes.map((scene) => scene.entryId || scene.urlId)); @@ -133,6 +133,14 @@ async function curateData(data) { } async function init() { + if (!args.studioId) { + throw new Error('No StashDB studio ID specified'); + } + + if (!args.network && !args.channel) { + throw new Error('No traxxx channel or network specified'); + } + const res = await unprint.post('https://stashdb.org/graphql', { operationName: 'Scenes', query,