This commit is contained in:
2026-05-08 20:48:29 +08:00
parent abf1f1ebea
commit 94975e4735
82 changed files with 7786 additions and 1012 deletions

View File

@@ -1682,14 +1682,10 @@ pub(crate) fn map_visual_novel_agent_session_procedure_result(
let session_json = result
.session_json
.ok_or_else(|| SpacetimeClientError::missing_snapshot("visual novel agent session 快照"))?;
let session =
serde_json::from_str::<VisualNovelAgentSessionJsonRecord>(&session_json).map_err(
|error| {
SpacetimeClientError::Runtime(format!(
"visual novel session_json 非法: {error}"
))
},
)?;
let session = serde_json::from_str::<VisualNovelAgentSessionJsonRecord>(&session_json)
.map_err(|error| {
SpacetimeClientError::Runtime(format!("visual novel session_json 非法: {error}"))
})?;
Ok(map_visual_novel_agent_session_snapshot(session))
}
@@ -1721,13 +1717,15 @@ pub(crate) fn map_visual_novel_works_procedure_result(
let items_json = result
.items_json
.ok_or_else(|| SpacetimeClientError::missing_snapshot("visual novel works 快照"))?;
let items = serde_json::from_str::<Vec<VisualNovelWorkJsonRecord>>(&items_json).map_err(
|error| {
let items =
serde_json::from_str::<Vec<VisualNovelWorkJsonRecord>>(&items_json).map_err(|error| {
SpacetimeClientError::Runtime(format!("visual novel works items_json 非法: {error}"))
},
)?;
})?;
Ok(items.into_iter().map(map_visual_novel_work_snapshot).collect())
Ok(items
.into_iter()
.map(map_visual_novel_work_snapshot)
.collect())
}
pub(crate) fn map_visual_novel_run_procedure_result(
@@ -1762,7 +1760,10 @@ pub(crate) fn map_visual_novel_history_procedure_result(
SpacetimeClientError::Runtime(format!("visual novel history items_json 非法: {error}"))
})?;
Ok(items.into_iter().map(map_visual_novel_history_entry).collect())
Ok(items
.into_iter()
.map(map_visual_novel_history_entry)
.collect())
}
pub(crate) fn map_visual_novel_runtime_event_procedure_result(
@@ -1776,9 +1777,7 @@ pub(crate) fn map_visual_novel_runtime_event_procedure_result(
.event_json
.ok_or_else(|| SpacetimeClientError::missing_snapshot("visual novel runtime event 快照"))?;
let event = serde_json::from_str::<VisualNovelRuntimeEventJsonRecord>(&event_json).map_err(
|error| {
SpacetimeClientError::Runtime(format!("visual novel event_json 非法: {error}"))
},
|error| SpacetimeClientError::Runtime(format!("visual novel event_json 非法: {error}")),
)?;
Ok(map_visual_novel_runtime_event(event))