From ab9fe881c0531b5dd4e2a648e65d4d04b991b807 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 May 2019 20:08:43 -0700 Subject: hide abstracts and refs in release expansions --- rust/src/entity_crud.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'rust/src') diff --git a/rust/src/entity_crud.rs b/rust/src/entity_crud.rs index f348e8dc..240a7d92 100644 --- a/rust/src/entity_crud.rs +++ b/rust/src/entity_crud.rs @@ -1045,6 +1045,9 @@ impl EntityCrud for FileEntity { } // Could potentially hit this code path when expanding a redirected entity or bare // revision. In either case, `self.release_ids` should already be set. + let mut hide_flags = HideFlags::none(); + hide_flags.abstracts = true; + hide_flags.refs = true; if expand.releases && self.release_ids.is_some() { if let Some(release_ids) = &self.release_ids { self.releases = Some( @@ -1054,7 +1057,7 @@ impl EntityCrud for FileEntity { Ok(ReleaseEntity::db_get( conn, FatcatId::from_str(release_id)?, - HideFlags::none(), + hide_flags, )?) }) .collect::>>()?, @@ -1245,6 +1248,9 @@ impl EntityCrud for FilesetEntity { } // Could potentially hit this code path when expanding a redirected entity or bare // revision. In either case, `self.release_ids` should already be set. + let mut hide_flags = HideFlags::none(); + hide_flags.abstracts = true; + hide_flags.refs = true; if expand.releases && self.release_ids.is_some() { if let Some(release_ids) = &self.release_ids { self.releases = Some( @@ -1254,7 +1260,7 @@ impl EntityCrud for FilesetEntity { Ok(ReleaseEntity::db_get( conn, FatcatId::from_str(release_id)?, - HideFlags::none(), + hide_flags, )?) }) .collect::>>()?, @@ -1482,6 +1488,9 @@ impl EntityCrud for WebcaptureEntity { } // Could potentially hit this code path when expanding a redirected entity or bare // revision. In either case, `self.release_ids` should already be set. + let mut hide_flags = HideFlags::none(); + hide_flags.abstracts = true; + hide_flags.refs = true; if expand.releases && self.release_ids.is_some() { if let Some(release_ids) = &self.release_ids { self.releases = Some( @@ -1491,7 +1500,7 @@ impl EntityCrud for WebcaptureEntity { Ok(ReleaseEntity::db_get( conn, FatcatId::from_str(release_id)?, - HideFlags::none(), + hide_flags, )?) }) .collect::>>()?, -- cgit v1.2.3