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