Compare commits
No commits in common. "4a1a8027403994a9a341843212a44ad8ac588298" and "f11a009395070111e582bfb618713f6af638af6b" have entirely different histories.
4a1a802740
...
f11a009395
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.237.25",
|
"version": "1.237.24",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.237.25",
|
"version": "1.237.24",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-s3": "^3.458.0",
|
"@aws-sdk/client-s3": "^3.458.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.237.25",
|
"version": "1.237.24",
|
||||||
"description": "All the latest porn releases in one place",
|
"description": "All the latest porn releases in one place",
|
||||||
"main": "src/app.js",
|
"main": "src/app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -6,7 +6,6 @@ const args = require('yargs').argv;
|
||||||
const { format } = require('date-fns');
|
const { format } = require('date-fns');
|
||||||
|
|
||||||
const knex = require('../knex');
|
const knex = require('../knex');
|
||||||
const filterTitle = require('../utils/filter-title');
|
|
||||||
|
|
||||||
const mantiClient = new manticore.ApiClient();
|
const mantiClient = new manticore.ApiClient();
|
||||||
|
|
||||||
|
@ -117,7 +116,7 @@ async function init() {
|
||||||
const docs = scenes.map((scene) => {
|
const docs = scenes.map((scene) => {
|
||||||
const flatActors = scene.actors.flatMap((actor) => actor.f2.match(/[\w']+/g)); // match word characters to filter out brackets etc.
|
const flatActors = scene.actors.flatMap((actor) => actor.f2.match(/[\w']+/g)); // match word characters to filter out brackets etc.
|
||||||
const flatTags = scene.tags.filter((tag) => tag.f3 > 6).flatMap((tag) => (tag.f4 ? `${tag.f2} ${tag.f4}` : tag.f2).match(/[\w']+/g)); // only make top tags searchable to minimize cluttered results
|
const flatTags = scene.tags.filter((tag) => tag.f3 > 6).flatMap((tag) => (tag.f4 ? `${tag.f2} ${tag.f4}` : tag.f2).match(/[\w']+/g)); // only make top tags searchable to minimize cluttered results
|
||||||
const filteredTitle = filterTitle(scene.title, [...flatActors, ...flatTags]);
|
const filteredTitle = scene.title && [...flatActors, ...flatTags].reduce((accTitle, tag) => accTitle.replace(new RegExp(tag.replace(/[^\w\s]+/g, ''), 'i'), ''), scene.title).trim().replace(/\s{2,}/, ' ');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
replace: {
|
replace: {
|
||||||
|
|
|
@ -7,7 +7,6 @@ const knex = require('./knex');
|
||||||
const logger = require('./logger')(__filename);
|
const logger = require('./logger')(__filename);
|
||||||
const bulkInsert = require('./utils/bulk-insert');
|
const bulkInsert = require('./utils/bulk-insert');
|
||||||
const chunk = require('./utils/chunk');
|
const chunk = require('./utils/chunk');
|
||||||
const filterTitle = require('./utils/filter-title');
|
|
||||||
|
|
||||||
const mantiClient = new manticore.ApiClient();
|
const mantiClient = new manticore.ApiClient();
|
||||||
const indexApi = new manticore.IndexApi(mantiClient);
|
const indexApi = new manticore.IndexApi(mantiClient);
|
||||||
|
@ -124,7 +123,7 @@ async function updateManticoreSceneSearch(releaseIds) {
|
||||||
const docs = scenes.rows.map((scene) => {
|
const docs = scenes.rows.map((scene) => {
|
||||||
const flatActors = scene.actors.flatMap((actor) => actor.f2.split(' '));
|
const flatActors = scene.actors.flatMap((actor) => actor.f2.split(' '));
|
||||||
const flatTags = scene.tags.filter((tag) => tag.f3 > 6).flatMap((tag) => [tag.f2].concat(tag.f4)).filter(Boolean); // only make top tags searchable to minimize cluttered results
|
const flatTags = scene.tags.filter((tag) => tag.f3 > 6).flatMap((tag) => [tag.f2].concat(tag.f4)).filter(Boolean); // only make top tags searchable to minimize cluttered results
|
||||||
const filteredTitle = filterTitle(scene.title, [...flatActors, ...flatTags]);
|
const filteredTitle = scene.title && [...flatActors, ...flatTags].reduce((accTitle, tag) => accTitle.replace(new RegExp(`\\b${tag.replace(/[^\w\s]+/g, '')}\\b`, 'gi'), ''), scene.title).trim().replace(/\s{2,}/, ' ');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
replace: {
|
replace: {
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
function filterTitle(title, keys) {
|
|
||||||
if (!title) {
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
|
|
||||||
return keys.reduce((accTitle, tag) => accTitle.replace(new RegExp(`\\b${tag.replace(/[^\w\s]+/g, '')}\\b`, 'gi'), ''), title).trim().replace(/\s{2,}/, ' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = filterTitle;
|
|
Loading…
Reference in New Issue