From 29d6d1d2b516335d3a7db178c3a8617f6183721f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Mon, 19 Sep 2022 11:55:22 +0000 Subject: [PATCH] empty ticker handling --- api/ovdashboard_api/routers/v1/ticker.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/ovdashboard_api/routers/v1/ticker.py b/api/ovdashboard_api/routers/v1/ticker.py index ac90230..85cecf8 100644 --- a/api/ovdashboard_api/routers/v1/ticker.py +++ b/api/ovdashboard_api/routers/v1/ticker.py @@ -64,9 +64,13 @@ async def get_ticker_content_lines( async def get_ticker_content( ticker_content_lines: Iterator[str] = Depends(get_ticker_content_lines), ) -> str: + ticker_content_padded = ["", *ticker_content_lines, ""] + if len(ticker_content_padded) == 2: + return "" + cfg = await Config.get() ticker_content = cfg.ticker.separator.join( - ["", *ticker_content_lines, ""], + ticker_content_padded, ) return ticker_content.strip()