mirror of
https://github.com/Pandipipas/scoreko-dev.git
synced 2026-06-06 03:32:06 +00:00
feat: enhance pack management and character handling; implement automatic registry refresh and logo display updates
This commit is contained in:
@@ -85,6 +85,7 @@ const reply = (ack: Acknowledgement | undefined, err: Error | null, result?: unk
|
||||
|
||||
const IMAGE_EXTENSIONS = ['png', 'webp', 'jpg', 'jpeg', 'avif'] as const;
|
||||
|
||||
|
||||
// Raíz del proyecto: 2 niveles por encima de extension/pack-manager.js
|
||||
// Usamos import.meta.url porque nodecg.bundleDir no está disponible cuando
|
||||
// NodeCG se usa como dependencia en lugar de servidor standalone.
|
||||
@@ -211,6 +212,7 @@ const trySaveImage = async (
|
||||
const checkForUpdates = (): void => {
|
||||
const registry = packRegistryRep.value;
|
||||
const installed = installedPacksRep.value ?? [];
|
||||
|
||||
if (!registry || installed.length === 0) {
|
||||
availableUpdatesRep.value = {};
|
||||
return;
|
||||
@@ -372,7 +374,7 @@ nodecg.listenFor('updatePack', async (packId: unknown, ack: Acknowledgement | un
|
||||
const packDir = path.join(packsDir, packId);
|
||||
const charsDir = path.join(packDir, 'characters');
|
||||
|
||||
// 2. Limpiar imágenes antiguas (evita residuos de personajes renombrados/eliminados)
|
||||
// 2. Limpiar imágenes antiguas para evitar residuos de personajes renombrados
|
||||
if (fs.existsSync(charsDir)) {
|
||||
fs.rmSync(charsDir, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user