From e99080abd30cc504c0918e7c3b76e61539de4108 Mon Sep 17 00:00:00 2001 From: Elie Gambache Date: Fri, 26 Jun 2026 06:56:44 +0300 Subject: [PATCH] fix(generator): don't abort the build on unmatched generation titles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit seedGenerations called require(unmatchedTitles.isEmpty()), so the whole DB build failed whenever generations.csv (ForDB) referenced a book missing from the current otzaria-library — an upstream drift between the two sources. Keep every generation link that matched and log a warning for the rest instead. --- .../sefariasqlite/SeedGenerationsPostProcess.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/generator/sefariasqlite/src/jvmMain/kotlin/io/github/kdroidfilter/seforimlibrary/sefariasqlite/SeedGenerationsPostProcess.kt b/generator/sefariasqlite/src/jvmMain/kotlin/io/github/kdroidfilter/seforimlibrary/sefariasqlite/SeedGenerationsPostProcess.kt index 8c1f740b..a7320498 100644 --- a/generator/sefariasqlite/src/jvmMain/kotlin/io/github/kdroidfilter/seforimlibrary/sefariasqlite/SeedGenerationsPostProcess.kt +++ b/generator/sefariasqlite/src/jvmMain/kotlin/io/github/kdroidfilter/seforimlibrary/sefariasqlite/SeedGenerationsPostProcess.kt @@ -150,9 +150,14 @@ private fun applyGenerations( linksCreated += linkStmt.executeUpdate() } } - require(unmatchedTitles.isEmpty()) { - "Generation CSV has ${unmatchedTitles.size} unmatched book title(s): " + - unmatchedTitles.take(20).joinToString() + // Don't abort the whole build when generations.csv references books that are + // not in the current library (upstream otzaria-library vs ForDB drift): keep + // every link that DID match and just warn about the rest. + if (unmatchedTitles.isNotEmpty()) { + logger.w { + "Generation CSV has ${unmatchedTitles.size} unmatched book title(s) (skipped): " + + unmatchedTitles.take(20).joinToString() + } } return GenerationApplyResult(generationsCreated, linksCreated, 0) }