Updating Manticore scenes after tag reassociation.
This commit is contained in:
@@ -3026,7 +3026,7 @@ const priorities = [ // higher index is higher priority
|
|||||||
['facial', 'swallowing', 'creampie', 'anal-creampie', 'oral-creampie', 'cum-in-mouth', 'throatpie'],
|
['facial', 'swallowing', 'creampie', 'anal-creampie', 'oral-creampie', 'cum-in-mouth', 'throatpie'],
|
||||||
['lesbian', 'rough', 'milf', 'male-focus', 'bdsm', 'oil'],
|
['lesbian', 'rough', 'milf', 'male-focus', 'bdsm', 'oil'],
|
||||||
['threesome', 'mfm', 'mff', 'trainbang', 'pissing'],
|
['threesome', 'mfm', 'mff', 'trainbang', 'pissing'],
|
||||||
['anal', 'bukkake'],
|
['anal', 'bukkake', 'spitroast'],
|
||||||
['dp', 'dap', 'triple-penetration', 'tap', 'dvp', 'tvp', 'airtight'],
|
['dp', 'dap', 'triple-penetration', 'tap', 'dvp', 'tvp', 'airtight'],
|
||||||
['blowbang', 'orgy'],
|
['blowbang', 'orgy'],
|
||||||
['gangbang'],
|
['gangbang'],
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ const logger = require('./logger')(__filename);
|
|||||||
const knex = require('./knex');
|
const knex = require('./knex');
|
||||||
|
|
||||||
const { fetchEntityReleaseIds } = require('./entities');
|
const { fetchEntityReleaseIds } = require('./entities');
|
||||||
|
const { updateSceneSearch } = require('./update-search');
|
||||||
|
|
||||||
const slugify = require('./utils/slugify');
|
const slugify = require('./utils/slugify');
|
||||||
const batchInsert = require('./utils/batch-insert');
|
const batchInsert = require('./utils/batch-insert');
|
||||||
@@ -199,6 +200,8 @@ async function reassociateTagEntries(tagEntries, rematch) {
|
|||||||
tag_id: matchedTags[slugify(tagEntry.original_tag)],
|
tag_id: matchedTags[slugify(tagEntry.original_tag)],
|
||||||
})).filter((tagEntry) => tagEntry.tag_id);
|
})).filter((tagEntry) => tagEntry.tag_id);
|
||||||
|
|
||||||
|
const sceneIds = Array.from(new Set(updatedTagEntries.map((tagEntry) => tagEntry.release_id))).filter(Boolean);
|
||||||
|
|
||||||
if (updatedTagEntries.length > 0) {
|
if (updatedTagEntries.length > 0) {
|
||||||
const trx = await knex.transaction();
|
const trx = await knex.transaction();
|
||||||
|
|
||||||
@@ -212,10 +215,13 @@ async function reassociateTagEntries(tagEntries, rematch) {
|
|||||||
})), {
|
})), {
|
||||||
conflict: false,
|
conflict: false,
|
||||||
transaction: trx,
|
transaction: trx,
|
||||||
|
commit: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await updateSceneSearch(sceneIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info(`Updated ${updatedTagEntries.length} tags in ${new Set(updatedTagEntries.map((tagEntry) => tagEntry.release_id)).size} scenes`);
|
logger.info(`Updated ${updatedTagEntries.length} tags in ${sceneIds.length} scenes`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function reassociateReleaseTags(rawSceneIds, rematch) {
|
async function reassociateReleaseTags(rawSceneIds, rematch) {
|
||||||
|
|||||||
Reference in New Issue
Block a user