diff --git a/src/main/java/io/github/paexception/engelsburg/api/service/scheduled/SubstituteUpdateService.java b/src/main/java/io/github/paexception/engelsburg/api/service/scheduled/SubstituteUpdateService.java index 6296bd5..43119b1 100644 --- a/src/main/java/io/github/paexception/engelsburg/api/service/scheduled/SubstituteUpdateService.java +++ b/src/main/java/io/github/paexception/engelsburg/api/service/scheduled/SubstituteUpdateService.java @@ -185,8 +185,8 @@ public void updateSubstitutes() { //If the row does not contain a className then this row is used to extend the text from // the previous substitute, so it needs to be added to the latest substitute - String className = row.child(0).text(); - if (!substitutes.isEmpty() && !className.matches("(.*)[0-9](.*)")) { + String lesson = row.child(1).text(); + if (!substitutes.isEmpty() && !lesson.matches("(.*)[0-9](.*)")) { this.appendTextOnLastSubstitute(row, substitutes); String appendedText = substitutes.get(substitutes.size() - 1).getText(); @@ -274,7 +274,7 @@ private List createSubstituteDTOs(Element row, Date currentDate) List dtos = new ArrayList<>(); SubstituteDTO dto = new SubstituteDTO(); dto.setDate(currentDate); - dto.setClassName(row.child(0).text()); + if (row.child(0).text().matches("(.*)[0-9](.*)")) dto.setClassName(row.child(0).text()); String lessons = row.child(1).text().replace(" ", ""); if (lessons.contains("-")) { //5 - 6, //3 - 6 int low = Integer.parseInt(lessons.substring(0, lessons.indexOf("-"))),