Skip to content

Commit ef859a2

Browse files
authored
fix(generator): don't abort the build on unmatched generation titles (#86)
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.
1 parent 3ac2df4 commit ef859a2

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎generator/sefariasqlite/src/jvmMain/kotlin/io/github/kdroidfilter/seforimlibrary/sefariasqlite/SeedGenerationsPostProcess.kt‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,14 @@ private fun applyGenerations(
150150
linksCreated += linkStmt.executeUpdate()
151151
}
152152
}
153-
require(unmatchedTitles.isEmpty()) {
154-
"Generation CSV has ${unmatchedTitles.size} unmatched book title(s): " +
155-
unmatchedTitles.take(20).joinToString()
153+
// Don't abort the whole build when generations.csv references books that are
154+
// not in the current library (upstream otzaria-library vs ForDB drift): keep
155+
// every link that DID match and just warn about the rest.
156+
if (unmatchedTitles.isNotEmpty()) {
157+
logger.w {
158+
"Generation CSV has ${unmatchedTitles.size} unmatched book title(s) (skipped): " +
159+
unmatchedTitles.take(20).joinToString()
160+
}
156161
}
157162
return GenerationApplyResult(generationsCreated, linksCreated, 0)
158163
}

0 commit comments

Comments
 (0)