From c765d67a72dfdd01c9974cac86a12953a63b066c Mon Sep 17 00:00:00 2001 From: Janne Kerola Date: Mon, 18 Sep 2023 11:02:23 +0300 Subject: [PATCH] fix: fix empty prints with english opts (#34) fix empty print bug with english opts --- src/jmenu/api.py | 2 +- src/jmenu/main.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/jmenu/api.py b/src/jmenu/api.py index 6f4c419..7c78036 100644 --- a/src/jmenu/api.py +++ b/src/jmenu/api.py @@ -74,6 +74,6 @@ def _parse_items(data: list[dict], relevant_menus: list[str] = []) -> list[MenuI sorted(mealopts, key=lambda x: x["orderNumber"]) for opt in mealopts: for item in opt["menuItems"]: - if item["name"] not in SKIPPED_ITEMS: + if item["name"] not in SKIPPED_ITEMS and len(item["name"]) > 0: items.append(MenuItem(item["name"], item["diets"])) return items diff --git a/src/jmenu/main.py b/src/jmenu/main.py index a69df68..66c7479 100644 --- a/src/jmenu/main.py +++ b/src/jmenu/main.py @@ -116,7 +116,6 @@ def _print_menu(args: _ArgsNamespace): for res in RESTAURANTS: try: items = fetch_restaurant_items(res, fetch_date, args.lang_code) - if len(items) == 0: print(res.name.ljust(8), "--") else: