@tricoteuses/senat 2.19.8 → 2.19.9
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.
|
@@ -163,8 +163,22 @@ export async function retrieveCriXmlDump(dataDir, options = {}) {
|
|
|
163
163
|
const seanceTs = Date.parse(yyyymmdd.slice(0, 4) + "-" + yyyymmdd.slice(4, 6) + "-" + yyyymmdd.slice(6, 8));
|
|
164
164
|
if (seanceTs < cutoff) {
|
|
165
165
|
// Check if some file exists sarting with CRSSN{yyyymmdd} in transformed dir
|
|
166
|
-
const
|
|
167
|
-
|
|
166
|
+
const files = await fs.readdir(transformedSessionDir);
|
|
167
|
+
const dayFiles = files.filter((fn) => fn.startsWith(`CRSSN${yyyymmdd}-`) && fn.endsWith(".json"));
|
|
168
|
+
if (dayFiles.length > 0) {
|
|
169
|
+
// Link existing files to agendas
|
|
170
|
+
for (const fn of dayFiles) {
|
|
171
|
+
const match = fn.match(/^CRSSN(\d{8})-(.+)\.json$/);
|
|
172
|
+
const slot = match?.[2];
|
|
173
|
+
const crPath = path.join(transformedSessionDir, fn);
|
|
174
|
+
try {
|
|
175
|
+
const cr = await fs.readJSON(crPath);
|
|
176
|
+
await linkCriSlotIntoAgendaGrouped(dataDir, yyyymmdd, slot, cr.uid, cr, session);
|
|
177
|
+
}
|
|
178
|
+
catch (e) {
|
|
179
|
+
console.warn(`[AGENDA] [${session}] Could not link existing CR into grouped for ${yyyymmdd} ${slot}:`, e);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
168
182
|
continue;
|
|
169
183
|
}
|
|
170
184
|
}
|