fixes and improvements
This commit is contained in:
@@ -56,6 +56,47 @@ def get_monitoring_overview(
|
||||
}
|
||||
|
||||
|
||||
@router.get("/shortcuts")
|
||||
def get_shortcuts(
|
||||
store=Depends(get_settings_store),
|
||||
) -> list[dict[str, Any]]:
|
||||
"""Return dashboard shortcut records."""
|
||||
shortcuts = store.list_shortcuts()
|
||||
logger.info("Dashboard shortcuts count=%s", len(shortcuts))
|
||||
return shortcuts
|
||||
|
||||
|
||||
@router.post("/shortcuts")
|
||||
def create_shortcut(
|
||||
payload: dict[str, Any],
|
||||
store=Depends(get_settings_store),
|
||||
) -> dict[str, Any]:
|
||||
shortcut = store.upsert_shortcut(payload)
|
||||
logger.info("Created dashboard shortcut id=%s type=%s", shortcut.get("id"), shortcut.get("shortcut_type"))
|
||||
return shortcut
|
||||
|
||||
|
||||
@router.put("/shortcuts/{shortcut_id}")
|
||||
def update_shortcut(
|
||||
shortcut_id: str,
|
||||
payload: dict[str, Any],
|
||||
store=Depends(get_settings_store),
|
||||
) -> dict[str, Any]:
|
||||
shortcut = store.upsert_shortcut(payload, shortcut_id)
|
||||
logger.info("Updated dashboard shortcut id=%s type=%s", shortcut.get("id"), shortcut.get("shortcut_type"))
|
||||
return shortcut
|
||||
|
||||
|
||||
@router.delete("/shortcuts/{shortcut_id}")
|
||||
def delete_shortcut(
|
||||
shortcut_id: str,
|
||||
store=Depends(get_settings_store),
|
||||
) -> dict[str, str]:
|
||||
store.delete_shortcut(shortcut_id)
|
||||
logger.info("Deleted dashboard shortcut id=%s", shortcut_id)
|
||||
return {"status": "deleted"}
|
||||
|
||||
|
||||
def _map_sessions_to_activity_rows(sessions: list[dict[str, Any]]) -> list[dict[str, Any]]:
|
||||
"""Normalize Jellyfin sessions into dashboard activity rows."""
|
||||
results: list[dict[str, Any]] = []
|
||||
|
||||
Reference in New Issue
Block a user