feat: add visible flag for works

This commit is contained in:
kdletters
2026-05-27 19:30:10 +08:00
parent a7bba70ca5
commit 8e96c8a67c
29 changed files with 198 additions and 12 deletions

View File

@@ -39,6 +39,7 @@ pub fn square_hole_gallery_view(ctx: &AnonymousViewContext) -> Vec<SquareHoleGal
.square_hole_work_profile()
.by_square_hole_work_publication_status()
.filter(SQUARE_HOLE_PUBLICATION_PUBLISHED)
.filter(|row| row.visible)
.filter_map(|row| match build_gallery_view_row(&row) {
Ok(item) => Some(item),
Err(error) => {
@@ -537,6 +538,7 @@ fn compile_square_hole_draft_tx(
play_count: 0,
updated_at: compiled_at,
published_at: None,
visible: true,
};
upsert_work(ctx, work);
replace_session(
@@ -614,6 +616,7 @@ fn update_square_hole_work_tx(
play_count: current.play_count,
updated_at,
published_at: current.published_at,
visible: current.visible,
};
let snapshot = build_work_snapshot(&next)?;
replace_work(ctx, &current, next);
@@ -1141,6 +1144,7 @@ fn clone_work(row: &SquareHoleWorkProfileRow) -> SquareHoleWorkProfileRow {
play_count: row.play_count,
updated_at: row.updated_at,
published_at: row.published_at,
visible: row.visible,
}
}