Converting expression before storing. Pre-fixed some Bang! channel names with 'Bang!'.

This commit is contained in:
DebaucheryLibrarian 2024-05-29 23:57:38 +02:00
parent 43d85bcd34
commit f956f0e112
4 changed files with 14 additions and 14 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -908,7 +908,7 @@ const sites = [
}, },
// BANG // BANG
{ {
name: 'Trickery', name: 'Bang! Trickery',
slug: 'bangtrickery', slug: 'bangtrickery',
url: 'https://www.bang.com/videos?in=BANG%21+Trickery', url: 'https://www.bang.com/videos?in=BANG%21+Trickery',
parameters: { siteId: 4800 }, parameters: { siteId: 4800 },
@ -930,20 +930,20 @@ const sites = [
parent: 'bang', parent: 'bang',
}, },
{ {
name: 'Surprise', name: 'Bang! Surprise',
slug: 'bangsurprise', slug: 'bangsurprise',
url: 'https://www.bang.com/videos?in=BANG%21+Surprise', url: 'https://www.bang.com/videos?in=BANG%21+Surprise',
parameters: { siteId: 5000 }, parameters: { siteId: 5000 },
parent: 'bang', parent: 'bang',
}, },
{ {
name: 'Adventures', name: 'Bang! Adventures',
slug: 'bangadventures', slug: 'bangadventures',
url: 'https://www.bang.com/videos?in=BANG%21+adventures', url: 'https://www.bang.com/videos?in=BANG%21+adventures',
parent: 'bang', parent: 'bang',
}, },
{ {
name: 'Real Teens', name: 'Bang! Real Teens',
slug: 'bangrealteens', slug: 'bangrealteens',
alias: ['brealteens'], alias: ['brealteens'],
url: 'https://www.bang.com/videos?in=BANG%21+Real+Teens', url: 'https://www.bang.com/videos?in=BANG%21+Real+Teens',
@ -965,21 +965,21 @@ const sites = [
parent: 'bang', parent: 'bang',
}, },
{ {
name: 'Japan', name: 'Bang! Japan',
slug: 'bangjapan', slug: 'bangjapan',
url: 'https://www.bang.com/videos?in=BANG%21+Japan', url: 'https://www.bang.com/videos?in=BANG%21+Japan',
parameters: { siteId: 3079, ignore: true }, parameters: { siteId: 3079, ignore: true },
parent: 'bang', parent: 'bang',
}, },
{ {
name: 'Rammed', name: 'Bang! Rammed',
slug: 'bangrammed', slug: 'bangrammed',
url: 'https://www.bang.com/videos?in=BANG%21+Rammed', url: 'https://www.bang.com/videos?in=BANG%21+Rammed',
parameters: { siteId: 4836 }, parameters: { siteId: 4836 },
parent: 'bang', parent: 'bang',
}, },
{ {
name: 'Glamkore', name: 'Bang! Glamkore',
slug: 'bangglamkore', slug: 'bangglamkore',
alias: ['bglamkore'], alias: ['bglamkore'],
url: 'https://www.bang.com/videos?in=BANG%21+Glamkore', url: 'https://www.bang.com/videos?in=BANG%21+Glamkore',
@ -994,7 +994,7 @@ const sites = [
parent: 'bang', parent: 'bang',
}, },
{ {
name: 'Real MILFs', name: 'Bang! Real MILFs',
slug: 'bangrealmilfs', slug: 'bangrealmilfs',
alias: ['brealmilfs'], alias: ['brealmilfs'],
url: 'https://www.bang.com/videos?in=BANG%21+Real+Milfs', url: 'https://www.bang.com/videos?in=BANG%21+Real+Milfs',
@ -1002,7 +1002,7 @@ const sites = [
parent: 'bang', parent: 'bang',
}, },
{ {
name: 'Confessions', name: 'Bang! Confessions',
slug: 'bangconfessions', slug: 'bangconfessions',
alias: ['bconfessions'], alias: ['bconfessions'],
url: 'https://www.bang.com/videos?in=BANG%21+Confessions', url: 'https://www.bang.com/videos?in=BANG%21+Confessions',
@ -1010,7 +1010,7 @@ const sites = [
parent: 'bang', parent: 'bang',
}, },
{ {
name: 'Casting', name: 'Bang! Casting',
slug: 'bangcasting', slug: 'bangcasting',
alias: ['bcasting'], alias: ['bcasting'],
url: 'https://www.bang.com/videos?in=BANG%21+Casting', url: 'https://www.bang.com/videos?in=BANG%21+Casting',

View File

@ -41,7 +41,9 @@ async function addAlert(alert, sessionUser) {
alert.matches?.length > 0 && bulkInsert('alerts_matches', alert.matches.map((match) => ({ alert.matches?.length > 0 && bulkInsert('alerts_matches', alert.matches.map((match) => ({
alert_id: alertId, alert_id: alertId,
property: match.property, property: match.property,
expression: match.expression, expression: /\/.*\//.test(match.expression)
? match.expression.slice(1, -1)
: escapeRegexp(match.expression),
})), false), })), false),
alert.stashes?.length > 0 && bulkInsert('alerts_stashes', alert.stashes.map((stashId) => ({ alert.stashes?.length > 0 && bulkInsert('alerts_stashes', alert.stashes.map((stashId) => ({
alert_id: alertId, alert_id: alertId,
@ -115,9 +117,7 @@ async function notify(scenes) {
acc[alertMatch.alert_id].push({ acc[alertMatch.alert_id].push({
property: alertMatch.property, property: alertMatch.property,
expression: /\/.*\//.test(alertMatch.expression) expression: new RegExp(alertMatch.expression, 'ui'),
? new RegExp(alertMatch.expression.slice(1, -1), 'ui')
: new RegExp(escapeRegexp(alertMatch.expression), 'ui'),
}); });
return acc; return acc;