Add support for downloading latest Modrinth version#153
Open
spartacus04 wants to merge 2 commits into
Open
Conversation
… is specified Agent-Logs-Url: https://github.com/spartacus04/run-task/sessions/9cb4cf90-352d-4381-9473-7667fc141dcd Co-authored-by: spartacus04 <52862005+spartacus04@users.noreply.github.com>
…latest-version Add Modrinth latest version download support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for downloading the latest available version of a plugin from Modrinth when no specific version is provided. It introduces new APIs and logic to handle this use case, and updates the relevant classes to make the plugin version optional.
Modrinth plugin download improvements:
modrinth(id: String)function inDownloadPluginsSpecand correspondingadd(id: String)method in theModrinthApiinterface, allowing users to specify only the plugin ID to download the latest version. [1] [2]add(id: String)method inModrinthApiImpl, creating aModrinthApiDownloadjob with only the plugin ID set.Version handling changes:
versionproperty inModrinthApiDownloadoptional, updating its annotations and string representation to reflect when the latest version is used.ModrinthApiDownloadto handle the optionalversionproperty correctly.Download resolution logic:
PluginDownloadServiceImplto resolve the latest version from the Modrinth API if no version is specified, fetching the version list and selecting the newest entry. Also added a supporting data class for version list entries. [1] [2]Other technical adjustments:
@Optionalannotation import for Gradle tasks.This was quick and dirty, I literally vibe coded this because I didn't really have time in my hands. If you need a more "human" patch lmk I'll make sure to do that