Skip to content
This repository has been archived by the owner on Mar 21, 2023. It is now read-only.

Commit

Permalink
Misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed Oct 20, 2021
1 parent fb33bbe commit 0328959
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/models/incident.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class Incident extends Model {
longitude: pokestop.lon,
pokestop_name: pokestop.name || oldPokestop && oldPokestop.name || "Unknown",
url: pokestop.url || oldPokestop && oldPokestop.url,
lure_expiration: pokestop.lureExpireTimestamp || 0,
last_modified: pokestop.lastModifiedTimestamp || 0,
enabled: pokestop.enabled || true,
lure_id: pokestop.lureId || 0,
Expand Down
8 changes: 3 additions & 5 deletions src/models/pokestop.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ class Pokestop extends Model {
if (fort.active_fort_modifier.length > 1) console.warn('[Lure] More than one lure?', record.id);
record.lureId = fort.active_fort_modifier[0];
record.lureFirstSeenTimestamp = record.lastModifiedTimestamp;
if (config.dataparser.lure.v2) {
record.lureExpireTimestamp = null;
}
record.lureExpireTimestamp = null;
} else record.lureExpireTimestamp = 0;
let incidents = [];
if (config.dataparser.incident.v1 || config.dataparser.incident.v2) {
Expand Down Expand Up @@ -309,13 +307,13 @@ class Pokestop extends Model {
if (this.lureExpireTimestamp !== 0) {
if (oldPokestop.lureId === this.lureId && (oldPokestop.lureExpireTimestamp === null ||
oldPokestop.lureExpireTimestamp >= this.updated)) {
this.lureFirstSeenTimestamp = oldPokestop.firstSeenTimestamp;
this.lureFirstSeenTimestamp = oldPokestop.lureFirstSeenTimestamp;
this.lureExpireTimestamp = oldPokestop.lureExpireTimestamp;
} else {
WebhookController.instance.addLureEvent(this.toJson('lure', oldPokestop));
}
}
} else {
} else if (this.lureExpireTimestamp !== 0) {
this.lureExpireTimestamp = this.estimateLureExpireLegacy(
oldPokestop.lureExpireTimestamp > 0 && this.lureId === oldPokestop.lureId
? oldPokestop.lureExpireTimestamp - Pokestop.LureTime : this.lastModifiedTimestamp);
Expand Down

0 comments on commit 0328959

Please sign in to comment.