api: minor fixes

This commit is contained in:
Jörn-Michael Miehe 2023-10-27 00:40:04 +02:00
parent a6fa709d52
commit 50f67e5ad5
2 changed files with 3 additions and 3 deletions

View file

@ -25,7 +25,7 @@ class DAVSettings(BaseModel):
username: str | None = None username: str | None = None
password: str | None = None password: str | None = None
cache_ttl: int = 60 * 30 cache_ttl: int = 60 * 10
cache_size: int = 1024 cache_size: int = 1024
@property @property

View file

@ -31,8 +31,8 @@ async def get_lan_ip() -> str:
family=AF_INET, family=AF_INET,
type=SOCK_DGRAM, type=SOCK_DGRAM,
) as s: ) as s:
s.settimeout(0)
try: try:
s.settimeout(0)
s.connect((SETTINGS.ping_host, SETTINGS.ping_port)) s.connect((SETTINGS.ping_host, SETTINGS.ping_port))
IP = s.getsockname()[0] IP = s.getsockname()[0]
@ -44,7 +44,7 @@ async def get_lan_ip() -> str:
@router.get("/version") @router.get("/version")
async def get_server_api_version() -> str: async def get_server_api_version() -> str:
return importlib.metadata.version("ovdashboard-api") return importlib.metadata.version("ovdashboard_api")
@router.get("/config/server") @router.get("/config/server")