This commit is contained in:
Christopher Cookman 2025-01-11 01:13:26 -07:00
parent f0206fae4e
commit 7f25924206

View file

@ -105,8 +105,8 @@ async function checkForNewEndpoints() {
let newContacts = []; let newContacts = [];
for (const endpoint of parsed) { for (const endpoint of parsed) {
const seen = await db.getObjectDefault(`/seen/${endpoint.endpoint}`, []); const seen = await db.getObjectDefault(`/seen/${endpoint.endpoint}`, []);
const newEndpointContacts = endpoint.contacts.filter(contact => !seen.includes(contact.host.split(":")[0])); const newEndpointContacts = endpoint.contacts.filter(contact => !seen.includes(contact.host?.split(":")[0]));
const uniqueHosts = [...new Set(newEndpointContacts.map(contact => contact.host.split(":")[0]))]; const uniqueHosts = [...new Set(newEndpointContacts.map(contact => contact.host?.split(":")[0]))];
uniqueHosts.forEach(host => { uniqueHosts.forEach(host => {
db.push(`/seen/${endpoint.endpoint}[]`, host); db.push(`/seen/${endpoint.endpoint}[]`, host);
}); });