feat: Add levels to pack
parent
4451979a47
commit
ddbd9e8303
|
@ -4,5 +4,6 @@ interface Pack {
|
||||||
name: string;
|
name: string;
|
||||||
bpm: string;
|
bpm: string;
|
||||||
files: File[];
|
files: File[];
|
||||||
|
levels: number;
|
||||||
}
|
}
|
||||||
export default Pack;
|
export default Pack;
|
||||||
|
|
|
@ -25,6 +25,7 @@ export default class PackService {
|
||||||
let files: File[] = [];
|
let files: File[] = [];
|
||||||
const name = packName;
|
const name = packName;
|
||||||
let bpm: string = "";
|
let bpm: string = "";
|
||||||
|
let levels = 0;
|
||||||
|
|
||||||
// Setup walk
|
// Setup walk
|
||||||
const noDots = (entry: fsWalk.Entry) => !entry.name.startsWith(".");
|
const noDots = (entry: fsWalk.Entry) => !entry.name.startsWith(".");
|
||||||
|
@ -44,6 +45,9 @@ export default class PackService {
|
||||||
if (file.name === "bpm.txt") {
|
if (file.name === "bpm.txt") {
|
||||||
bpm = await fs.readFileSync(file.path).toString();
|
bpm = await fs.readFileSync(file.path).toString();
|
||||||
}
|
}
|
||||||
|
if (file.name.includes('music')) {
|
||||||
|
levels++;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -55,6 +59,7 @@ export default class PackService {
|
||||||
name: name,
|
name: name,
|
||||||
bpm: bpm,
|
bpm: bpm,
|
||||||
files: files,
|
files: files,
|
||||||
|
levels: levels,
|
||||||
};
|
};
|
||||||
|
|
||||||
return currentPack;
|
return currentPack;
|
||||||
|
|
Loading…
Reference in New Issue