Skip to content

Commit

Permalink
fix: improve no mealplan detection
Browse files Browse the repository at this point in the history
  • Loading branch information
jmesserli committed Feb 19, 2024
1 parent 090f919 commit 0eba434
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.2
4.1.2
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>nu.peg</groupId>
<artifactId>svmeal-api</artifactId>
<version>4.1.1</version>
<version>4.1.2</version>
<packaging>jar</packaging>

<name>svmeal-api</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public MealPlansDto convert(Document document) {
List<String> dateStrings =
document.select(".day-nav ul li label span.date").stream().map(Element::text).toList();

if (dateStrings.isEmpty()) {
return null;
}

for (int dayOffset = 0; dayOffset < 7; dayOffset++) {
Elements menuPlanTab = document.select(String.format(MENU_PLAN_TAB_FORMAT, dayOffset + 1));
if (menuPlanTab.isEmpty()) {
Expand Down

0 comments on commit 0eba434

Please sign in to comment.