Fix: www/ movido a raíz, estructura final
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const p = 'descargar-curso/.mapa_videos.json';
|
||||
let m = {};
|
||||
try {
|
||||
if (fs.existsSync(p)) {
|
||||
m = JSON.parse(fs.readFileSync(p, 'utf-8'));
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
const files = fs.readdirSync('descargar-curso/descargas/videos_offline');
|
||||
for (const f of files) {
|
||||
const match = f.match(/MX_video_(\d+)/);
|
||||
if (match) {
|
||||
m[match[1]] = f;
|
||||
}
|
||||
}
|
||||
fs.writeFileSync(p, JSON.stringify(m, null, 2), "utf-8");
|
||||
console.log("Map rebuilt.");
|
||||
Reference in New Issue
Block a user