You've already forked AstralRinth
forked from didirus/AstralRinth
Performance improvements (#114)
* Performance improvements * run fmt * optimize creation modal * remove print, fix mod loader editing * Fix library update * update extract loading bar * Update theseus_gui/src-tauri/src/api/metadata.rs Co-authored-by: triphora <emma@modrinth.com> * fix cli --------- Co-authored-by: triphora <emma@modrinth.com>
This commit is contained in:
@@ -17,3 +17,9 @@ export async function get_fabric_versions() {
|
||||
export async function get_forge_versions() {
|
||||
return await invoke('metadata_get_forge_versions')
|
||||
}
|
||||
|
||||
// Gets the quilt versions from daedalus
|
||||
// Returns Manifest
|
||||
export async function get_quilt_versions() {
|
||||
return await invoke('metadata_get_quilt_versions')
|
||||
}
|
||||
|
||||
@@ -32,14 +32,18 @@ export async function remove(path) {
|
||||
|
||||
// Get a profile by path
|
||||
// Returns a Profile
|
||||
export async function get(path) {
|
||||
return await invoke('profile_get', { path })
|
||||
export async function get(path, clearProjects) {
|
||||
return await invoke('profile_get', { path, clearProjects })
|
||||
}
|
||||
|
||||
// Get a copy of the profile set
|
||||
// Returns hashmap of path -> Profile
|
||||
export async function list() {
|
||||
return await invoke('profile_list')
|
||||
export async function list(clearProjects) {
|
||||
return await invoke('profile_list', { clearProjects })
|
||||
}
|
||||
|
||||
export async function check_installed(path, projectId) {
|
||||
return await invoke('profile_check_installed', { path, projectId })
|
||||
}
|
||||
|
||||
// Syncs a profile with the disk
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { add_project_from_version as installMod } from '@/helpers/profile'
|
||||
import { add_project_from_version as installMod, check_installed } from '@/helpers/profile'
|
||||
import { ofetch } from 'ofetch'
|
||||
|
||||
export const releaseColor = (releaseType) => {
|
||||
@@ -14,17 +14,13 @@ export const releaseColor = (releaseType) => {
|
||||
}
|
||||
}
|
||||
|
||||
export const checkInstalled = (profile, projectId) => {
|
||||
return Object.values(profile.projects).some((p) => p.metadata?.project?.id === projectId)
|
||||
}
|
||||
|
||||
export const installVersionDependencies = async (profile, version) => {
|
||||
for (const dep of version.dependencies) {
|
||||
if (dep.version_id) {
|
||||
if (checkInstalled(profile, dep.project_id)) continue
|
||||
if (await check_installed(profile.path, dep.project_id)) continue
|
||||
await installMod(profile.path, dep.version_id)
|
||||
} else {
|
||||
if (checkInstalled(profile, dep.project_id)) continue
|
||||
if (await check_installed(profile.path, dep.project_id)) continue
|
||||
const depVersions = await ofetch(
|
||||
`https://api.modrinth.com/v2/project/${dep.project_id}/version`
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user