diff --git a/api/ovdashboard_api/config.py b/api/ovdashboard_api/config.py index 3e213ac..83e61a4 100644 --- a/api/ovdashboard_api/config.py +++ b/api/ovdashboard_api/config.py @@ -50,7 +50,6 @@ class ImageConfig(BaseModel): class Config(BaseModel): ticker_separator: str = " +++ " - cache_seconds: int = 30 image: ImageConfig = ImageConfig() diff --git a/api/ovdashboard_api/routers/text.py b/api/ovdashboard_api/routers/text.py index 2b426ab..683a250 100644 --- a/api/ovdashboard_api/routers/text.py +++ b/api/ovdashboard_api/routers/text.py @@ -4,7 +4,7 @@ from typing import Iterator from fastapi import APIRouter, Depends from markdown import markdown -from ..settings import SETTINGS +from ..config import Config from ..dav_file import DavFile from ._common import FileNameLister, PrefixFinder, PrefixUnique @@ -46,8 +46,12 @@ async def get_ticker_content_lines( async def get_ticker_content( ticker_content_lines: Iterator[str] = Depends(get_ticker_content_lines), ) -> str: + cfg = await Config.get() + ticker_content_lines = ["", *ticker_content_lines, ""] + ticker_content = cfg.ticker_separator.join(ticker_content_lines) + return markdown( - SETTINGS.ticker_separator.join(ticker_content_lines) + ticker_content.strip() ) diff --git a/api/ovdashboard_api/settings.py b/api/ovdashboard_api/settings.py index b55f4f2..8cd9aaf 100644 --- a/api/ovdashboard_api/settings.py +++ b/api/ovdashboard_api/settings.py @@ -31,7 +31,6 @@ class Settings(BaseSettings): dav_password: str = "changeme" dav_path: str = "ovdashboard" - ticker_separator: str = " +++ " cache_seconds: int = 30 @property