empty ticker handling
This commit is contained in:
parent
16348530ee
commit
29d6d1d2b5
1 changed files with 5 additions and 1 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue