diff --git a/agenda/thespacedevs.py b/agenda/thespacedevs.py index 15ad455..3192448 100644 --- a/agenda/thespacedevs.py +++ b/agenda/thespacedevs.py @@ -136,7 +136,7 @@ def summarize_launch(launch: Launch) -> Summary: "launch_provider": launch_provider, "launch_provider_abbrev": launch_provider_abbrev, "launch_provider_type": get_nested(launch, ["launch_service_provider", "type"]), - "rocket": launch["rocket"]["configuration"]["full_name"], + "rocket": launch["rocket"]["configuration"], "mission": launch.get("mission"), "mission_name": get_nested(launch, ["mission", "name"]), "pad_name": launch["pad"]["name"], @@ -174,7 +174,10 @@ def get_launches( existing.sort(reverse=True) if refresh or not existing or (now - existing[0][0]).seconds > ttl: - return next_launch_api(rocket_dir, limit=limit) + try: + return next_launch_api(rocket_dir, limit=limit) + except Exception: + pass # fallback to cached version f = existing[0][1] diff --git a/templates/launches.html b/templates/launches.html index a8baede..1756424 100644 --- a/templates/launches.html +++ b/templates/launches.html @@ -6,7 +6,40 @@
Mission type: + + {% if request.args.type %}🗙{% endif %} + + {% for t in mission_types | sort %} + {% if t == request.args.type %} + {{ t }} + {% else %} + + {{ t }} + + {% endif %} + {% if not loop.last %} | {% endif %} + {% endfor %} +
+ +Vehicle: + {% if request.args.rocket %}🗙{% endif %} + + {% for r in rockets | sort %} + {% if r == request.args.rockets %} + {{ r }} + {% else %} + + {{ r }} + + {% endif %} + {% if not loop.last %} | {% endif %} + {% endfor %} +
+ + {% for launch in launches %} {% set highlight =" bg-primary-subtle" if launch.slug in config.FOLLOW_LAUNCHES else "" %} {% set country = get_country(launch.country_code) %}