Some checks failed
Deploy Multi-VM / Deploy VM Web (push) Has been cancelled
Deploy Multi-VM / Deploy VM Auth (push) Has been cancelled
Deploy Multi-VM / Deploy Game Servers (docker-compose.fusionfall.yml, VM_FUSIONFALL_HOST, VM_FUSIONFALL_SSH_KEY, VM_FUSIONFALL_USER, fusionfall) (push) Has been cancelled
Deploy Multi-VM / Deploy Game Servers (docker-compose.maple2.yml, VM_MAPLE2_HOST, VM_MAPLE2_SSH_KEY, VM_MAPLE2_USER, maple2) (push) Has been cancelled
Deploy Multi-VM / Deploy Game Servers (docker-compose.minecraft.yml, VM_MINECRAFT_HOST, VM_MINECRAFT_SSH_KEY, VM_MINECRAFT_USER, minecraft) (push) Has been cancelled
Deploy Multi-VM / Deploy Game Servers (docker-compose.retro.yml, VM_RETRO_HOST, VM_RETRO_SSH_KEY, VM_RETRO_USER, retro) (push) Has been cancelled
- Redesign all internal pages to warm/gold aesthetic (catalog, game detail, documentary, about, donate, community, guides, contact, server-status, login, profile, admin, not-found) - Add real cover images for all 4 games via Strapi CMS with getImageUrl helper - Integrate NextAuth v5 with Authentik OIDC authentication - Add new public pages: community, guides, contact, server-status - Add new protected pages: login, profile, admin dashboard - Remove legacy AFC/MercadoPago system entirely - Add Docker Compose split files for service isolation (main, auth, fusionfall, nier) - Add OpenFusion VM deployment configs (config.vm.ini, systemd service, README-VM) - Add NieR Reincarnation server guide and desktop client guide - Add architecture docs for multi-VM deployment - Add healthcheck, SSE, contact, newsletter, admin API routes - Add reusable UI components, skeleton loaders, activity feed, bookmark system - Update deployment and game server documentation
72 lines
2.4 KiB
JavaScript
72 lines
2.4 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Fix Spanish chapter links to Spanish documentaries
|
|
*/
|
|
|
|
const STRAPI_URL = "http://localhost:1337";
|
|
|
|
async function apiRequest(endpoint, method = "GET", body = null) {
|
|
const url = `${STRAPI_URL}/api${endpoint}`;
|
|
const options = {
|
|
method,
|
|
headers: { "Content-Type": "application/json" },
|
|
...(body ? { body: JSON.stringify(body) } : {}),
|
|
};
|
|
const response = await fetch(url, options);
|
|
const data = await response.json().catch(() => null);
|
|
if (!response.ok) {
|
|
throw new Error(`${response.status}: ${JSON.stringify(data)}`);
|
|
}
|
|
return data;
|
|
}
|
|
|
|
// Map chapter titles to documentary IDs (Spanish)
|
|
const docMap = {
|
|
"nier": 19,
|
|
"dbo": 21,
|
|
"fusionfall": 3,
|
|
"maple": 6,
|
|
};
|
|
|
|
function getDocId(title) {
|
|
const t = title.toLowerCase();
|
|
if (t.includes("jaula") || t.includes("melancolia") || t.includes("recuerdos") || t.includes("pasado") || t.includes("grietas") || t.includes("suspiro")) return docMap.nier;
|
|
if (t.includes("mundo abierto") || t.includes("toriyama") || t.includes("año 1000") || t.includes("guerreros") || t.includes("frontera") || t.includes("ultimo deseo")) return docMap.dbo;
|
|
if (t.includes("cubos") || t.includes("juguete") || t.includes("musica del maple") || t.includes("espada") || t.includes("tormentas") || t.includes("hoja")) return docMap.maple;
|
|
if (t.includes("alianza") || t.includes("planet fusion") || t.includes("creadores") || t.includes("fusions") || t.includes("red que se rompio") || t.includes("juicio")) return docMap.fusionfall;
|
|
return null;
|
|
}
|
|
|
|
async function main() {
|
|
console.log("🔧 Fixing Spanish chapter links...\n");
|
|
|
|
// Get all Spanish chapters
|
|
const res = await apiRequest("/chapters?pagination[pageSize]=200&locale=es");
|
|
const chapters = res.data || [];
|
|
console.log(`Found ${chapters.length} Spanish chapters`);
|
|
|
|
for (const ch of chapters) {
|
|
const docId = getDocId(ch.title);
|
|
if (!docId) {
|
|
console.log(` ⚠️ Could not map: ${ch.title}`);
|
|
continue;
|
|
}
|
|
|
|
try {
|
|
await apiRequest(`/chapters/${ch.documentId}?locale=es`, "PUT", {
|
|
data: { documentary: docId },
|
|
});
|
|
console.log(` ✅ ${ch.title} → doc ${docId}`);
|
|
} catch (err) {
|
|
console.log(` ❌ ${ch.title}: ${err.message}`);
|
|
}
|
|
}
|
|
|
|
console.log("\n✨ Done!");
|
|
}
|
|
|
|
main().catch((err) => {
|
|
console.error("💥 Fatal error:", err.message);
|
|
process.exit(1);
|
|
});
|