Vendetta/API/get latest

From Quasar-RCE
Revision as of 03:23, 11 June 2025 by Luxen (talk | contribs) (reformatted wording and better clarified behavior of function and its min/max filtering)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Definition

lib.get_latest (id, [min, max]) :: mod_version

Description

Retrieves the latest version of an enabled mod, or the latest within a range of versions that is installed

Arguments

  1. string id: name of the mod to look up
  2. (optional) string min: minimum version to limit the range to
  3. (optional) string max: maximum version to limit the range to

Returns

  1. string mod_version: the latest version of the installed mod, or the latest installed within the provided range. If no version satisfies the provided range, returns "?".

Other notes

  • Added in LME 3.x.x
    • Changed in 3.8.x: Added support for min/max version filtering
  • Other API functions, when given mod version "0", use this function to resolve the appropriate version.
  • This function prioritizes the latest active version. If none are active, then retrieves latest installed version.
  • Both min and max must be provided for version range filtering to apply.
  • Unlike most LME functions, "0" is not treated as a placeholder for "latest" within the min/max filter (this function does not call itself).
    • To filter from a minimum version without defining a real maximum, first call lib.get_latest(id) to obtain the latest available, to get the current latest, then pass that as max