feat(plugins): isolate device integrations
This commit is contained in:
@@ -31,16 +31,15 @@ from k1link.sessions import (
|
||||
SessionStore,
|
||||
validate_recorded_media_timeline,
|
||||
)
|
||||
from k1link.viewer.rerun_bridge import RerunSceneSettings
|
||||
from k1link.viewer.rrd_export import (
|
||||
from k1link.viewer.recorded import (
|
||||
APPLICATION_ID as RECORDED_APPLICATION_ID,
|
||||
)
|
||||
from k1link.viewer.rrd_export import (
|
||||
RrdExportError,
|
||||
from k1link.viewer.recorded import (
|
||||
RecordedBlueprintError,
|
||||
recorded_blueprint_rrd,
|
||||
)
|
||||
from k1link.viewer.rerun_bridge import RerunSceneSettings
|
||||
|
||||
DEFAULT_REPLAY_PLUGIN_ID = "nodedc.device.xgrids-lixelkity-k1"
|
||||
DEFAULT_REPLAY_ACTION_ID = "stream.start-replay"
|
||||
SAFE_SOURCE_ID = re.compile(r"^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$")
|
||||
SAFE_SHA256 = re.compile(r"^[a-f0-9]{64}$")
|
||||
@@ -234,7 +233,6 @@ def build_session_router(
|
||||
recording_preparation_manager: SessionRecordingPreparationManager | None = None,
|
||||
media_inspector: RecordedMediaInspector | None = None,
|
||||
allow_synchronous_recording_fallback: bool = False,
|
||||
replay_plugin_id: str = DEFAULT_REPLAY_PLUGIN_ID,
|
||||
replay_action_id: str = DEFAULT_REPLAY_ACTION_ID,
|
||||
) -> APIRouter:
|
||||
"""Build generic host APIs without exposing filesystem locators to clients."""
|
||||
@@ -388,7 +386,7 @@ def build_session_router(
|
||||
"schema_version": "missioncore.observation-session-replay/v1",
|
||||
"launch": {
|
||||
"kind": "plugin-action",
|
||||
"plugin_id": replay_plugin_id,
|
||||
"plugin_id": command.plugin_id,
|
||||
"action_id": replay_action_id,
|
||||
"session_id": command.session_id,
|
||||
"speed": command.speed,
|
||||
@@ -671,7 +669,7 @@ def build_session_router(
|
||||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
except (SessionNotReplayableError, SessionIntegrityError) as exc:
|
||||
raise HTTPException(status_code=409, detail=str(exc)) from exc
|
||||
except RrdExportError as exc:
|
||||
except RecordedBlueprintError as exc:
|
||||
raise HTTPException(
|
||||
status_code=500,
|
||||
detail="Не удалось подготовить настройки визуализатора.",
|
||||
|
||||
Reference in New Issue
Block a user