Merge branch 'master' into codex/frontend-error-dialogs
# Conflicts: # .hermes/shared-memory/decision-log.md # server-rs/crates/api-server/src/generated_asset_sheets.rs
This commit is contained in:
@@ -1548,7 +1548,7 @@ pub async fn list_puzzle_gallery(
|
||||
let rebuild_started_at = std::time::Instant::now();
|
||||
let items = state
|
||||
.spacetime_client()
|
||||
.list_puzzle_gallery()
|
||||
.list_public_work_gallery_entries()
|
||||
.await
|
||||
.map_err(|error| {
|
||||
puzzle_error_response(
|
||||
@@ -1561,7 +1561,8 @@ pub async fn list_puzzle_gallery(
|
||||
let response = build_puzzle_gallery_window_response(
|
||||
items
|
||||
.into_iter()
|
||||
.map(|item| map_puzzle_gallery_card_response(&state, item))
|
||||
.filter(|item| item.source_type == "puzzle")
|
||||
.map(|item| map_public_work_puzzle_gallery_card_response(&state, item))
|
||||
.collect(),
|
||||
);
|
||||
let cached_response = state
|
||||
@@ -1919,6 +1920,7 @@ pub async fn advance_puzzle_next_level(
|
||||
Err(error) if error.status() == StatusCode::UNSUPPORTED_MEDIA_TYPE => {
|
||||
AdvancePuzzleNextLevelRequest {
|
||||
target_profile_id: None,
|
||||
prefer_similar_work: false,
|
||||
}
|
||||
}
|
||||
Err(error) => {
|
||||
@@ -1939,6 +1941,7 @@ pub async fn advance_puzzle_next_level(
|
||||
run_id,
|
||||
owner_user_id: principal.subject().to_string(),
|
||||
target_profile_id: payload.target_profile_id,
|
||||
prefer_similar_work: payload.prefer_similar_work,
|
||||
advanced_at_micros: current_utc_micros(),
|
||||
})
|
||||
.await
|
||||
|
||||
@@ -439,6 +439,46 @@ pub(super) fn map_puzzle_gallery_card_response(
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn map_public_work_puzzle_gallery_card_response(
|
||||
state: &PuzzleApiState,
|
||||
item: spacetime_client::PublicWorkGalleryEntryRecord,
|
||||
) -> PuzzleWorkSummaryResponse {
|
||||
let author = resolve_puzzle_work_author_by_user_id(
|
||||
state,
|
||||
&item.owner_user_id,
|
||||
Some(&item.author_display_name),
|
||||
None,
|
||||
);
|
||||
PuzzleWorkSummaryResponse {
|
||||
work_id: item.work_id,
|
||||
profile_id: item.profile_id,
|
||||
owner_user_id: item.owner_user_id,
|
||||
source_session_id: item.source_session_id,
|
||||
author_display_name: author.display_name,
|
||||
work_title: item.world_name.clone(),
|
||||
work_description: item.summary_text.clone(),
|
||||
level_name: item.world_name,
|
||||
summary: item.summary_text,
|
||||
theme_tags: item.theme_tags,
|
||||
cover_image_src: item.cover_image_src,
|
||||
cover_asset_id: item.cover_asset_id,
|
||||
publication_status: "published".to_string(),
|
||||
updated_at: item.updated_at,
|
||||
published_at: item.published_at,
|
||||
play_count: item.play_count,
|
||||
remix_count: item.remix_count,
|
||||
like_count: item.like_count,
|
||||
recent_play_count_7d: item.recent_play_count_7d,
|
||||
point_incentive_total_half_points: 0,
|
||||
point_incentive_claimed_points: 0,
|
||||
point_incentive_total_points: 0.0,
|
||||
point_incentive_claimable_points: 0,
|
||||
publish_ready: true,
|
||||
generation_status: Some("ready".to_string()),
|
||||
levels: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn map_puzzle_work_profile_response(
|
||||
state: &PuzzleApiState,
|
||||
item: PuzzleWorkProfileRecord,
|
||||
|
||||
Reference in New Issue
Block a user