diff --git a/librisworks/src/main/groovy/se/kb/libris/mergeworks/Util.groovy b/librisworks/src/main/groovy/se/kb/libris/mergeworks/Util.groovy index e67ba0dd66..84cfb00455 100644 --- a/librisworks/src/main/groovy/se/kb/libris/mergeworks/Util.groovy +++ b/librisworks/src/main/groovy/se/kb/libris/mergeworks/Util.groovy @@ -175,15 +175,9 @@ class Util { ] static void appendTitlePartsToMainTitle(Map title, String partNumber, String partName = null) { - if (title['mainTitle'][-1] != '.') { - title['mainTitle'] += '.' - } - if (partNumber && partName) { - title['mainTitle'] += " $partNumber, $partName" - } else if (partNumber) { - title['mainTitle'] += " $partNumber" - } else if (partName) { - title['mainTitle'] += " $partName" + def part = [partNumber, partName].grep().join(', ') + if (part) { + title['mainTitle'] += "${title['mainTitle'][-1] == '.' ? '' : '.'} $part" } }