version/0.1.4 #9
@@ -40,10 +40,10 @@ async function events_update_db() {
|
|||||||
console.log("AllRelevantEvents.length: " + AllRelevantEvents.length );
|
console.log("AllRelevantEvents.length: " + AllRelevantEvents.length );
|
||||||
const eventsToInsert: TEventEntityNew[] = [];
|
const eventsToInsert: TEventEntityNew[] = [];
|
||||||
for ( const ev of events_fetched ) {
|
for ( const ev of events_fetched ) {
|
||||||
console.log("loop ev: " + [ ev.uid, ev.title, ev.date_at ].join( ", " ) );
|
console.log("loop ev " + ev.uid + " : " + [ ev.title, ev.date_at ].join( ", " ) );
|
||||||
const found = AllRelevantEvents.find(event => event.uid === ev.uid);
|
const found = AllRelevantEvents.find(event => event.uid === ev.uid);
|
||||||
if ( found ) {
|
if ( found ) {
|
||||||
console.log("loop ev found: " + [ found.uid, found.title, found.date_at ].join( ", " ) );
|
console.log("loop ev " + ev.uid + " found: " + [ found.title, found.date_at ].join( ", " ) );
|
||||||
if (
|
if (
|
||||||
found.title != ev.title ||
|
found.title != ev.title ||
|
||||||
found.description != ev.description ||
|
found.description != ev.description ||
|
||||||
@@ -56,12 +56,12 @@ async function events_update_db() {
|
|||||||
found.timezone != ev.timezone ||
|
found.timezone != ev.timezone ||
|
||||||
found.link != ev.link
|
found.link != ev.link
|
||||||
) {
|
) {
|
||||||
console.log("loop ev different (changed): " + [ ev.uid, ev.title, ev.date_at ].join( ", " ) );
|
console.log("loop ev " + ev.uid + " different (changed): " + [ ev.title, ev.date_at ].join( ", " ) );
|
||||||
const newEventToInsert: TEventEntityNew = {... ev, notification: "changed"};
|
const newEventToInsert: TEventEntityNew = {... ev, notification: "changed"};
|
||||||
eventsToInsert.push( newEventToInsert );
|
eventsToInsert.push( newEventToInsert );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("loop ev added (new): " + [ ev.uid, ev.title, ev.date_at ].join( ", " ) );
|
console.log("loop ev " + ev.uid + " added (new): " + [ ev.title, ev.date_at ].join( ", " ) );
|
||||||
const newEventToInsert: TEventEntityNew = {... ev, notification: "new"};
|
const newEventToInsert: TEventEntityNew = {... ev, notification: "new"};
|
||||||
eventsToInsert.push( newEventToInsert );
|
eventsToInsert.push( newEventToInsert );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user