Switch mods to per-folder auto-discovery and resourcepack to single zip

- PackDefinition: replace mods[]/resourcepacks[] with modsFolder (string) + resourcepackPath (string); drop PackAsset
- Editor: replace dynamic add/remove lists with two single inputs; remove the now-dead JS for adding/removing rows
- Server: expose GET /file/mods/<folder>/index.json that returns the list of .jar names; folder name restricted to [a-zA-Z0-9_-]+
- Installer: fetch the listing JSON and download each jar from /file/mods/<folder>/<file>.jar; download the single resourcepack from /file/resourcepacks/<file>.zip directly into resourcepacks/

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-10 20:51:44 +09:00
parent 9c4f0e8dbc
commit 44847b8a55
9 changed files with 99 additions and 122 deletions

View File

@@ -122,14 +122,6 @@ opRouter.post('/op/dashboard/:packName', requireAuth, async (req, res, next) =>
const packKey = sanitizePackKey(pickFirstValue(req.params.packName))
const requestedKey = sanitizePackKey(pickFirstValue(req.body.fileName)) || packKey
const modNames = pickStringArray(req.body['modName']).map((value) => value.trim())
const modUrls = pickStringArray(req.body['modUrl']).map((value) => value.trim())
const mods = modNames.map((name, index) => ({ name, downloadUrl: modUrls[index] ?? '' }))
const resourceNames = pickStringArray(req.body['resourceName']).map((value) => value.trim())
const resourceUrls = pickStringArray(req.body['resourceUrl']).map((value) => value.trim())
const resourcepacks = resourceNames.map((name, index) => ({ name, downloadUrl: resourceUrls[index] ?? '' }))
const platformType = pickFirstValue(req.body.platformType)
const platformDownloadUrl = pickFirstValue(req.body.platformDownloadUrl).trim()
@@ -140,8 +132,8 @@ opRouter.post('/op/dashboard/:packName', requireAuth, async (req, res, next) =>
type: (platformType as PackDefinition['platform']['type']) || 'vanilla',
downloadUrl: platformDownloadUrl.length > 0 ? platformDownloadUrl : undefined
},
mods,
resourcepacks,
modsFolder: pickFirstValue(req.body.modsFolder),
resourcepackPath: pickFirstValue(req.body.resourcepackPath),
serverMinRam: Number(pickFirstValue(req.body.serverMinRam)),
serverMaxRam: Number(pickFirstValue(req.body.serverMaxRam)),
clientMinRam: Number(pickFirstValue(req.body.clientMinRam)),