aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-12-21 16:38:20 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-12-21 16:38:20 -0800
commitf1d6680a2ba11a67eefbfd742b6ddc81e12e43a5 (patch)
tree3419dbee13b9b2eec4965bb71fbe248f0a2d0124
parentb2cb78c023670d61e915db1d3341e808940a2197 (diff)
downloadfatcat-f1d6680a2ba11a67eefbfd742b6ddc81e12e43a5.tar.gz
fatcat-f1d6680a2ba11a67eefbfd742b6ddc81e12e43a5.zip
expand files for target of redirect
-rw-r--r--rust/src/api_entity_crud.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/rust/src/api_entity_crud.rs b/rust/src/api_entity_crud.rs
index 6474ba6f..151f0502 100644
--- a/rust/src/api_entity_crud.rs
+++ b/rust/src/api_entity_crud.rs
@@ -1021,7 +1021,12 @@ impl EntityCrud for ReleaseEntity {
if expand.files {
let ident = match &self.ident {
None => bail!("Can't expand files on a non-concrete entity"),
- Some(s) => FatCatId::from_str(&s)?,
+ Some(ident) => match &self.redirect {
+ // If we're a redirect, then expand for the *target* identifier, not *our*
+ // identifier. Tricky!
+ None => FatCatId::from_str(&ident)?,
+ Some(redir) => FatCatId::from_str(&redir)?,
+ },
};
self.files = Some(get_release_files(ident, HideFlags::none(), conn)?);
}