Added associate tags and associate series arguments.

This commit is contained in:
DebaucheryLibrarian 2026-02-03 05:51:35 +01:00
parent fd205aed88
commit b481ded6b3
2 changed files with 21 additions and 6 deletions

View File

@ -101,7 +101,17 @@ const { argv } = yargs
default: false,
})
.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',
default: true,
})

View File

@ -452,13 +452,18 @@ async function storeScenes(releases, useBatchId) {
const [actors, storedSeries] = await Promise.all([
argv.associateActors && associateActors(releasesWithId, batchId),
storeSeries(releasesWithId.map((release) => release.serie && { ...release.serie, entity: release.entity }).filter(Boolean), batchId),
associateReleaseTags(releasesWithId),
storeChapters(releasesWithId),
argv.associateSeries && storeSeries(releasesWithId.map((release) => release.serie && { ...release.serie, entity: release.entity }).filter(Boolean), batchId),
argv.associateTags && associateReleaseTags(releasesWithId),
argv.associateTags && storeChapters(releasesWithId),
]);
if (argv.associateSeries && storedSeries) {
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 updateSceneSearch(releasesWithId.map((release) => release.id));