Added user ID requirement to notify tool to prevent mass-notifying all users.
This commit is contained in:
@@ -616,25 +616,27 @@ export async function notify(sceneIds, options = {}) {
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
const alerts = rawAlerts.map((alert) => ({
|
||||
id: alert.id,
|
||||
userId: alert.user_id,
|
||||
username: alert.username,
|
||||
userEmail: alert.user_email,
|
||||
userSettings: alert.user_settings,
|
||||
notify: alert.notify,
|
||||
email: alert.email,
|
||||
all: alert.all,
|
||||
allActors: alert.all_actors,
|
||||
allEntities: alert.all_entities,
|
||||
allTags: alert.all_tags,
|
||||
allMatches: alert.all_matches,
|
||||
actorIds: alertActorIdsByAlertId[alert.id] || [],
|
||||
tagIds: alertTagIdsByAlertId[alert.id] || [],
|
||||
entityIds: alertEntityIdsByAlertId[alert.id] || [],
|
||||
matches: alertsMatchesByAlertId[alert.id] || [],
|
||||
stashIds: alertsStashesByAlertId[alert.id] || [],
|
||||
}));
|
||||
const alerts = rawAlerts
|
||||
.map((alert) => ({
|
||||
id: alert.id,
|
||||
userId: alert.user_id,
|
||||
username: alert.username,
|
||||
userEmail: alert.user_email,
|
||||
userSettings: alert.user_settings,
|
||||
notify: alert.notify,
|
||||
email: alert.email,
|
||||
all: alert.all,
|
||||
allActors: alert.all_actors,
|
||||
allEntities: alert.all_entities,
|
||||
allTags: alert.all_tags,
|
||||
allMatches: alert.all_matches,
|
||||
actorIds: alertActorIdsByAlertId[alert.id] || [],
|
||||
tagIds: alertTagIdsByAlertId[alert.id] || [],
|
||||
entityIds: alertEntityIdsByAlertId[alert.id] || [],
|
||||
matches: alertsMatchesByAlertId[alert.id] || [],
|
||||
stashIds: alertsStashesByAlertId[alert.id] || [],
|
||||
}))
|
||||
.filter((alert) => options.spoofUserIds ? options.spoofUserIds.includes(alert.userId) : true);
|
||||
|
||||
const curatedScenes = scenes
|
||||
.filter((scene) => scene.isNew || options.spoofNew)
|
||||
|
||||
Reference in New Issue
Block a user