aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-05-20 20:08:43 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-05-20 20:08:43 -0700
commitab9fe881c0531b5dd4e2a648e65d4d04b991b807 (patch)
treecf55b247d26a0e475cd553c3cef2b101ce41b622 /rust/src
parent3ebea73882a35ea1e892899d959efaed0264ec66 (diff)
downloadfatcat-ab9fe881c0531b5dd4e2a648e65d4d04b991b807.tar.gz
fatcat-ab9fe881c0531b5dd4e2a648e65d4d04b991b807.zip
hide abstracts and refs in release expansions
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/entity_crud.rs15
1 files changed, 12 insertions, 3 deletions
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::<Result<Vec<ReleaseEntity>>>()?,
@@ -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::<Result<Vec<ReleaseEntity>>>()?,
@@ -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::<Result<Vec<ReleaseEntity>>>()?,