(&self, mod_id: &str)
| 175 | } |
| 176 | |
| 177 | /// Signed direct artifact URL: `(size_bytes, url)`, or `None` when the store cannot sign |
| 178 | /// externally reachable URLs (local/dev/MinIO streaming compatibility) or the mod is absent. |
| 179 | pub async fn mod_artifact_signed_url(&self, mod_id: &str) -> Result<Option<(u64, String)>> { |
| 180 | match &self.mod_store { |
| 181 | Some(store) => store.signed_artifact_url(mod_id).await, |
| 182 | None => Ok(None), |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | pub async fn mod_versions(&self, mod_id: &str) -> Result<Vec<ModCatalogEntry>> { |
| 187 | let Some(current) = self.get_mod(mod_id).await? else { |
| 188 | return Ok(Vec::new()); |
| 189 | }; |
| 190 | |
| 191 | let family_key = mod_family_key(¤t); |
| 192 | let mut versions = self |
| 193 | .list_mods(&ListModsQuery::default()) |
| 194 | .await? |
| 195 | .into_iter() |
| 196 | .filter(|entry| mod_family_key(entry) == family_key) |
| 197 | .collect::<Vec<_>>(); |
| 198 | |
| 199 | versions.sort_by(|lhs, rhs| { |
| 200 | (lhs.mod_id != current.mod_id) |
no test coverage detected