Compare commits
No commits in common. "43d85bcd349b7d22e203ed99b21d306bae36d8ad" and "00a52c5f83f39d826d4b8f14ae733bd5d1e741fc" have entirely different histories.
43d85bcd34
...
00a52c5f83
|
@ -16,16 +16,6 @@ exports.up = async (knex) => {
|
||||||
.notNullable()
|
.notNullable()
|
||||||
.defaultTo(true);
|
.defaultTo(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
await knex.raw(`
|
|
||||||
UPDATE alerts
|
|
||||||
SET
|
|
||||||
all_actors = false,
|
|
||||||
all_entities = false,
|
|
||||||
all_tags = false,
|
|
||||||
all_matches= false
|
|
||||||
WHERE alerts.all = false;
|
|
||||||
`);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.down = async (knex) => {
|
exports.down = async (knex) => {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.237.12",
|
"version": "1.237.11",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.237.12",
|
"version": "1.237.11",
|
||||||
"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.12",
|
"version": "1.237.11",
|
||||||
"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": {
|
||||||
|
|
|
@ -129,10 +129,6 @@ async function notify(scenes) {
|
||||||
notify: alert.notify,
|
notify: alert.notify,
|
||||||
email: alert.email,
|
email: alert.email,
|
||||||
all: alert.all,
|
all: alert.all,
|
||||||
allActors: alert.all_actors,
|
|
||||||
allEntities: alert.all_entities,
|
|
||||||
allTags: alert.all_tags,
|
|
||||||
allMatches: alert.all_matches,
|
|
||||||
actors: alertsActorsByAlertId[alert.id] || [],
|
actors: alertsActorsByAlertId[alert.id] || [],
|
||||||
tags: alertsTagsByAlertId[alert.id] || [],
|
tags: alertsTagsByAlertId[alert.id] || [],
|
||||||
entities: alertsEntitiesByAlertId[alert.id] || [],
|
entities: alertsEntitiesByAlertId[alert.id] || [],
|
||||||
|
@ -153,11 +149,11 @@ async function notify(scenes) {
|
||||||
const triggers = alerts.flatMap((alert) => {
|
const triggers = alerts.flatMap((alert) => {
|
||||||
const alertScenes = curatedScenes.filter((scene) => {
|
const alertScenes = curatedScenes.filter((scene) => {
|
||||||
if (alert.all) {
|
if (alert.all) {
|
||||||
if (alert.actors.length > 0 && !alert.actors[alert.allActors ? 'every' : 'some']((actorId) => scene.actorIds.includes(actorId))) {
|
if (alert.actors.length > 0 && !alert.actors.every((actorId) => scene.actorIds.includes(actorId))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alert.tags.length > 0 && !alert.tags[alert.allTags ? 'every' : 'some']((tagId) => scene.tagIds.includes(tagId))) {
|
if (alert.tags.length > 0 && !alert.tags.every((tagId) => scene.tagIds.includes(tagId))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,27 +162,27 @@ async function notify(scenes) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alert.matches.length > 0 && !alert.matches[alert.allMatches ? 'every' : 'some']((match) => match.expression.test(scene[match.property]))) {
|
if (alert.matches.length > 0 && !alert.matches.every((match) => match.expression.test(scene[match.property]))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alert.matches.length > 0 && alert.actors[alert.allActors ? 'every' : 'some']((actorId) => scene.actorIds.includes(actorId))) {
|
if (alert.actors.some((actorId) => scene.actorIds.includes(actorId))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alert.tags.length > 0 && alert.tags[alert.allTags ? 'every' : 'some']((tagId) => scene.tagIds.includes(tagId))) {
|
if (alert.tags.some((tagId) => scene.tagIds.includes(tagId))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// multiple entities can only be matched in OR mode
|
// multiple entities can only be matched in OR mode
|
||||||
if (alert.entities.length > 0 && alert.entities.some((alertEntityId) => alertEntityId === scene.entityId || alertEntityId === scene.parentEntityId)) {
|
if (alert.entities.some((alertEntityId) => alertEntityId === scene.entityId || alertEntityId === scene.parentEntityId)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alert.matches.length > 0 && alert.matches[alert.allMatches ? 'every' : 'some']((match) => match.expression.test(scene[match.property]))) {
|
if (alert.matches.some((match) => match.expression.test(scene[match.property]))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue