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

Commit

Permalink
fix: Removes event parsing console spam
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Mar 22, 2022
1 parent 3e5bf5d commit 49fff4d
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/watcher/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ export class Watcher extends Component {
/** Metadata for a file has changed and the file should be checked. */
this.registerEvent(
this.metadataCache.on("changed", (file) => {
this.time = Date.now();
this.startParsing([file.path]);
})
);
Expand All @@ -147,15 +146,13 @@ export class Watcher extends Component {
type: "calendars",
calendars: this.calendars
});
this.time = Date.now();
this.startParsing([abstractFile.path]);
})
);
/** A file has been deleted and should be checked for events to unlink. */
this.registerEvent(
this.vault.on("delete", (abstractFile) => {
if (!(abstractFile instanceof TFile)) return;
const start = Date.now();
for (let calendar of this.calendars) {
const events = calendar.events.filter(
(event) => event.note === abstractFile.path
Expand Down Expand Up @@ -260,27 +257,12 @@ export class Watcher extends Component {
);
this.tree = new Map();
await this.plugin.saveCalendar();
console.log(
`Fantasy Calendar Event scanning complete in ${(
(Date.now() - this.time) /
1000
).toLocaleString("en-US", {
maximumFractionDigits: 3
})} seconds.`
);
}
}
);
this.start();
}
time: number;
start(calendar?: Calendar) {
console.log(
`Beginning Fantasy Calendar Event scanning for ${
calendar ? calendar.name : "all calendars"
}...`
);
this.time = Date.now();
const calendars = calendar ? [calendar] : this.calendars;
if (!calendars.length) return;
let folders: Set<string> = new Set();
Expand Down

0 comments on commit 49fff4d

Please sign in to comment.