Upload via GUI (39 Dateien)
This commit is contained in:
+20
-5
@@ -762,7 +762,11 @@ async function importMrpack(buf, zip) {
|
||||
const herkunft = await modpackHerkunft(buf, index);
|
||||
store.updateInstance(created.id, { modpack: Object.assign(herkunft, { dateien: eingespielt.dateien }) });
|
||||
|
||||
return { ok: true, instance: store.getInstance(created.id), fileCount: eingespielt.dateien.length };
|
||||
return {
|
||||
ok: true,
|
||||
instance: store.getInstance(created.id),
|
||||
fileCount: eingespielt.dateien.length,
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -921,7 +925,9 @@ ipcMain.handle('modpack:update', async (_e, id, versionId) => {
|
||||
if (SPIELERDATEN.some((r) => r.test(alt))) continue;
|
||||
const p = path.join(gameDir, String(alt).replace(/\//g, path.sep));
|
||||
if (!p.startsWith(gameDir + path.sep)) continue;
|
||||
try { if (fs.existsSync(p)) { fs.rmSync(p, { force: true }); entfernt.push(alt); } } catch { /* egal */ }
|
||||
try {
|
||||
if (fs.existsSync(p)) { fs.rmSync(p, { force: true }); entfernt.push(alt); }
|
||||
} catch { /* egal */ }
|
||||
}
|
||||
|
||||
// Minecraft-Version und Loader können sich mit der neuen Fassung ändern
|
||||
@@ -1514,7 +1520,10 @@ ipcMain.handle('mmc:import', (_e, entries, copyData) => {
|
||||
const done = [];
|
||||
const failed = [];
|
||||
for (const entry of entries || []) {
|
||||
try { done.push(mmcimport.importOne(store, entry, copyData !== false)); }
|
||||
try {
|
||||
const imported = mmcimport.importOne(store, entry, copyData !== false);
|
||||
done.push(imported);
|
||||
}
|
||||
catch (err) { failed.push({ name: entry.name, message: err.message }); }
|
||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||
mainWindow.webContents.send('mmc:progress', { current: done.length + failed.length, total: entries.length });
|
||||
@@ -1540,7 +1549,10 @@ ipcMain.handle('cf:import', (_e, entries, copyData) => {
|
||||
const done = [];
|
||||
const failed = [];
|
||||
for (const entry of entries || []) {
|
||||
try { done.push(cfimport.importOne(store, entry, copyData !== false)); }
|
||||
try {
|
||||
const imported = cfimport.importOne(store, entry, copyData !== false);
|
||||
done.push(imported);
|
||||
}
|
||||
catch (err) { failed.push({ name: entry.name, message: err.message }); }
|
||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||
mainWindow.webContents.send('cf:progress', { current: done.length + failed.length, total: entries.length });
|
||||
@@ -1566,7 +1578,10 @@ ipcMain.handle('mc:import', (_e, entries, copyData) => {
|
||||
const done = [];
|
||||
const failed = [];
|
||||
for (const entry of entries || []) {
|
||||
try { done.push(mcimport.importOne(store, entry, copyData !== false)); }
|
||||
try {
|
||||
const imported = mcimport.importOne(store, entry, copyData !== false);
|
||||
done.push(imported);
|
||||
}
|
||||
catch (err) { failed.push({ name: entry.name, message: err.message }); }
|
||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||
mainWindow.webContents.send('mc:progress', { current: done.length + failed.length, total: entries.length });
|
||||
|
||||
Reference in New Issue
Block a user