diff --git a/helpers/myradio_api.py b/helpers/myradio_api.py index 508501f..4f6f90a 100644 --- a/helpers/myradio_api.py +++ b/helpers/myradio_api.py @@ -94,16 +94,20 @@ class MyRadioAPI: if not payload["current"]: self._logException("API did not return a current show.") - return [] if not payload["next"]: self._logException("API did not return a list of next shows.") - return [] shows = [] shows.append(payload["current"]) shows.extend(payload["next"]) + timeslots = [] + # Remove jukebox etc + for show in shows: + if not "timeslot_id" in show: + shows.remove(show) + # TODO filter out jukebox return shows diff --git a/server.py b/server.py index e43a63a..17b019b 100644 --- a/server.py +++ b/server.py @@ -312,6 +312,7 @@ def channel_json(channel: int): @app.route("/plan/list") def list_showplans(): + while not api_from_q.empty(): api_from_q.get() # Just waste any previous status responses. @@ -620,6 +621,7 @@ def startServer(): port=state.state["port"], debug=True, use_reloader=False, + threaded=False # While API handles are singlethreaded. ) global webserver