empty ticker handling

This commit is contained in:
Jörn-Michael Miehe 2022-09-19 11:55:22 +00:00
parent 16348530ee
commit 29d6d1d2b5

View file

@ -64,9 +64,13 @@ async def get_ticker_content_lines(
async def get_ticker_content( async def get_ticker_content(
ticker_content_lines: Iterator[str] = Depends(get_ticker_content_lines), ticker_content_lines: Iterator[str] = Depends(get_ticker_content_lines),
) -> str: ) -> str:
ticker_content_padded = ["", *ticker_content_lines, ""]
if len(ticker_content_padded) == 2:
return ""
cfg = await Config.get() cfg = await Config.get()
ticker_content = cfg.ticker.separator.join( ticker_content = cfg.ticker.separator.join(
["", *ticker_content_lines, ""], ticker_content_padded,
) )
return ticker_content.strip() return ticker_content.strip()