From 5a6dceba9840aef24e2691abda15b6cea31c91d9 Mon Sep 17 00:00:00 2001 From: Richard Dern Date: Sat, 13 Dec 2025 23:20:48 +0100 Subject: [PATCH] Logs console moins verbeux --- tools/add_weather.js | 1 - tools/sync_lemmy_comments.js | 15 ++++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/add_weather.js b/tools/add_weather.js index 23bf08ee..e086c8ec 100644 --- a/tools/add_weather.js +++ b/tools/add_weather.js @@ -99,7 +99,6 @@ async function main() { break; default: skipped += 1; - console.log(`↷ Skipped ${relativePath} (${result.status})`); } } catch (error) { skipped += 1; diff --git a/tools/sync_lemmy_comments.js b/tools/sync_lemmy_comments.js index bd103582..bb053065 100644 --- a/tools/sync_lemmy_comments.js +++ b/tools/sync_lemmy_comments.js @@ -152,9 +152,14 @@ function selectArticles(bundles) { continue; } - const publication = parseFrontmatterDate(frontmatter.data?.date); + const rawDate = frontmatter.data?.date; + if (rawDate === null || rawDate === undefined || (typeof rawDate === "string" && rawDate.trim().length === 0)) { + continue; + } + + const publication = parseFrontmatterDate(rawDate); if (!publication) { - console.warn(`⚠️ ${bundle.relativePath} : date absente ou invalide, article ignoré.`); + console.warn(`⚠️ ${bundle.relativePath} : date invalide, article ignoré.`); continue; } @@ -213,11 +218,7 @@ async function ensureRestrictedCommunitiesForExistingThreads(bundles, lemmyConfi continue; } - const ensuredCommunity = await ensureCommunity(client, descriptor, lemmyConfig.community); - if (!ensuredCommunity.created && !ensuredCommunity.updated) { - const label = ensuredCommunity.title || descriptor.title || descriptor.name; - console.log(`🔒 Communauté Lemmy ${label} déjà verrouillée.`); - } + await ensureCommunity(client, descriptor, lemmyConfig.community); visited.add(descriptor.name); } }