MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / mod_versions

Method mod_versions

mserver/MasterService/src/service.rs:177–197  ·  view source on GitHub ↗
(&self, mod_id: &str)

Source from the content-addressed store, hash-verified

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(&current);
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)

Callers 1

list_mod_versionsFunction · 0.80

Calls 3

mod_family_keyFunction · 0.85
get_modMethod · 0.45
list_modsMethod · 0.45

Tested by

no test coverage detected