Fix mixed foundry detection
Change-Id: I09751e542bb396800e801fb99a0eb9e77a971b12
diff --git a/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXmlTool.kt b/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXmlTool.kt
index be972da..41f3361 100644
--- a/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXmlTool.kt
+++ b/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXmlTool.kt
@@ -897,7 +897,10 @@
// Build expected foundries from inventory: which ZIPs contain this text?
val expectedForThisText = zipInventory.filter { (_, texts) -> texts.contains(textId) }.keys
- .map { zipPath -> getFoundryFromZipFileName(File(zipPath).name) }
+ .flatMap { zipPath ->
+ val foundry = getFoundryFromZipFileName(File(zipPath).name)
+ if (foundry.contains("-")) foundry.split("-") else listOf(foundry)
+ }
.toSet()
if (!textFoundries.containsAll(expectedForThisText)) {