Improved StashDB import tool entity argument handling.
This commit is contained in:
parent
aa1a5bd95d
commit
6a5bb6a0f8
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue