Added associate tags and associate series arguments.
This commit is contained in:
parent
fd205aed88
commit
b481ded6b3
12
src/argv.js
12
src/argv.js
|
|
@ -101,7 +101,17 @@ const { argv } = yargs
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
.option('associate-actors', {
|
.option('associate-actors', {
|
||||||
describe: 'Associate scene actors',
|
describe: 'Associate scene actors and directors',
|
||||||
|
type: 'boolean',
|
||||||
|
default: true,
|
||||||
|
})
|
||||||
|
.option('associate-tags', {
|
||||||
|
describe: 'Associate scene tags',
|
||||||
|
type: 'boolean',
|
||||||
|
default: true,
|
||||||
|
})
|
||||||
|
.option('associate-series', {
|
||||||
|
describe: 'Associate scene series',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: true,
|
default: true,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -452,13 +452,18 @@ async function storeScenes(releases, useBatchId) {
|
||||||
|
|
||||||
const [actors, storedSeries] = await Promise.all([
|
const [actors, storedSeries] = await Promise.all([
|
||||||
argv.associateActors && associateActors(releasesWithId, batchId),
|
argv.associateActors && associateActors(releasesWithId, batchId),
|
||||||
storeSeries(releasesWithId.map((release) => release.serie && { ...release.serie, entity: release.entity }).filter(Boolean), batchId),
|
argv.associateSeries && storeSeries(releasesWithId.map((release) => release.serie && { ...release.serie, entity: release.entity }).filter(Boolean), batchId),
|
||||||
associateReleaseTags(releasesWithId),
|
argv.associateTags && associateReleaseTags(releasesWithId),
|
||||||
storeChapters(releasesWithId),
|
argv.associateTags && storeChapters(releasesWithId),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if (argv.associateSeries && storedSeries) {
|
||||||
await associateSerieScenes(storedSeries, releasesWithId);
|
await associateSerieScenes(storedSeries, releasesWithId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argv.associateActors && actors) {
|
||||||
await associateDirectors(releasesWithId, batchId); // some directors may also be actors, don't associate at the same time
|
await associateDirectors(releasesWithId, batchId); // some directors may also be actors, don't associate at the same time
|
||||||
|
}
|
||||||
|
|
||||||
await updateSceneSearch(releasesWithId.map((release) => release.id));
|
await updateSceneSearch(releasesWithId.map((release) => release.id));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue