Vendetta/API/get latest: Difference between revisions
From Quasar-RCE
Jump to navigationJump to search
created get_latest |
m reformatted wording and better clarified behavior of function and its min/max filtering |
||
Line 11: | Line 11: | ||
=== Returns === | === Returns === | ||
# string mod_version: the latest version of the installed mod, or the latest installed within the provided range | # 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 === | === Other notes === | ||
* Added in LME 3.x.x | * Added in LME 3.x.x | ||
** Changed in 3.8.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 | * 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. | * 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 |
Latest revision as of 03:23, 11 June 2025
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
- string id: name of the mod to look up
- (optional) string min: minimum version to limit the range to
- (optional) string max: maximum version to limit the range to
Returns
- 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