mirror of
https://github.com/williamsjack/pairwise-glicko-ranking.git
synced 2026-07-22 06:44:09 +00:00
Preload note IDs to improve matchmaking
This commit is contained in:
parent
4aa4805620
commit
98ce29e5fa
1 changed files with 16 additions and 0 deletions
|
|
@ -117,12 +117,28 @@ export default class ArenaSession {
|
|||
this.plugin.registerDomEvent(win, 'beforeunload', this.popoutUnloadHandler);
|
||||
}
|
||||
|
||||
await this.preloadFileIds();
|
||||
this.pickNextPair();
|
||||
await this.openCurrent();
|
||||
this.updateOverlay();
|
||||
this.updateStabilityBar();
|
||||
}
|
||||
|
||||
/**
|
||||
* Read note IDs for all files up-front so the matchmaker can look up
|
||||
* actual stats on the first pair pick, allowing the information-gain
|
||||
* algorithm to prioritise genuinely new notes.
|
||||
*/
|
||||
private async preloadFileIds(): Promise<void> {
|
||||
const propName = this.plugin.settings.idPropertyName;
|
||||
await Promise.all(
|
||||
this.files.map(async (f) => {
|
||||
const id = await getNoteId(this.app, f, propName);
|
||||
if (id) this.idByPath.set(f.path, id);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
async end(opts?: { forUnload?: boolean }) {
|
||||
this.clearScrollSync();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue