libroadcast-cli 2.4.1 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,7 +23,7 @@ const pushPGN = async (round, pgn) => {
23
23
  "White Player": game.tags["White"] || "Unknown",
24
24
  "Black Player": game.tags["Black"] || "Unknown",
25
25
  Result: game.tags["Result"] || "Unknown",
26
- "Ply Count": game.moves || "Unknown",
26
+ "Ply Count": game.moves ?? "Unknown",
27
27
  Error: game.error || "None",
28
28
  };
29
29
  }));
@@ -87,11 +87,14 @@ const readPGNFromURL = async (pgnURL, filterIds) => {
87
87
  return stats.toString();
88
88
  }
89
89
  };
90
+ let lastPGN = "";
90
91
  const loop = async (roundInfo, pgnPath, loopTimer, filterIds) => {
91
92
  while (true) {
92
93
  const pgnContent = await readPGNFromURL(pgnPath, filterIds);
93
- if (pgnContent)
94
+ if (pgnContent && pgnContent !== lastPGN) {
94
95
  await pushPGN(roundInfo, pgnContent);
96
+ lastPGN = pgnContent;
97
+ }
95
98
  await sleep(loopTimer * 1000);
96
99
  }
97
100
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libroadcast-cli",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "CLI to help with broadcast maintenance on Lichess",
5
5
  "main": "dist/index.js",
6
6
  "keywords": [