Added mods version selector

Added mods version selector
This commit is contained in:
dsqd2505-netizen
2026-02-24 17:04:46 +01:00
parent 19c8991a44
commit d5828463f9
7 changed files with 257 additions and 17 deletions

View File

@@ -285,6 +285,27 @@ async function toggleMod(modId, modsPath) {
}
}
async function getModFiles(modId) {
try {
const response = await axios.get(`https://api.curseforge.com/v1/mods/${modId}/files`, {
headers: {
'x-api-key': API_KEY,
'Accept': 'application/json'
},
params: {
pageSize: 20,
sortOrder: 'desc'
}
});
return response.data.data;
} catch (error) {
console.error('Error fetching mod files:', error);
return [];
}
}
async function syncModsForCurrentProfile() {
try {
const activeProfile = profileManager.getActiveProfile();
@@ -455,5 +476,6 @@ module.exports = {
syncModsForCurrentProfile,
generateModId,
extractModName,
extractVersion
};
extractVersion,
getModFiles
};