Skip to content

Commit 90d55bc

Browse files
committed
Will add better comments later, or maybe not lol
1 parent fc4ca68 commit 90d55bc

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

main/btf.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,20 @@ const { exec } = require('child_process');
88
const folderPath = path.join(__dirname, "./../out");
99
const outputFolder = path.join(__dirname, "./../output");
1010
const tempFolder = path.join(__dirname, "./../temp");
11-
const MAX_WORKERS = 24; // Maximální počet workerů
11+
const MAX_WORKERS = 24;
1212

1313
const args = process.argv.slice(2);
1414
const clearTemp = args.includes('-ct');
1515
const clearOutput = args.includes('-co');
1616

17-
// Vytvořte složky, pokud neexistují
1817
if (!fs.existsSync(outputFolder) || !fs.existsSync(tempFolder)) {
1918
!fs.existsSync(outputFolder) && fs.mkdirSync(outputFolder);
2019
!fs.existsSync(tempFolder) && fs.mkdirSync(tempFolder);
2120
}
2221

23-
// Vyčistěte složky, pokud je to požadováno
2422
if (clearTemp) fsExtra.emptyDirSync(tempFolder);
2523
if (clearOutput) fsExtra.emptyDirSync(outputFolder);
2624

27-
// Funkce pro vytvoření pokrokového ukazatele
2825
function createIntermediateProgressOutput(taskName, totalSteps, labelWidth = 40) {
2926
let lastDisplayed = 0;
3027
return function (currentStep) {
@@ -41,7 +38,6 @@ function createIntermediateProgressOutput(taskName, totalSteps, labelWidth = 40)
4138
};
4239
}
4340

44-
// Funkce pro převod nibbles na bajty
4541
function nibblesToBytes(nibbles) {
4642
const bytes = [];
4743
for (let i = 0; i < nibbles.length; i += 2) {
@@ -51,7 +47,6 @@ function nibblesToBytes(nibbles) {
5147
return bytes;
5248
}
5349

54-
// Funkce pro extrakci dat ze souboru
5550
function extractFileData(nibbles) {
5651
const dataNibbles = [];
5752
const nameNibbles = [];
@@ -74,7 +69,6 @@ function extractFileData(nibbles) {
7469
return { dataNibbles, nameNibbles };
7570
}
7671

77-
// Funkce pro zpracování souborů s omezeným počtem workerů
7872
async function processWithLimitedWorkers(filePaths, maxWorkers) {
7973
const progressTracker = new Array(filePaths.length).fill(0);
8074
const processFilesProgress = createIntermediateProgressOutput('Processing Images ->', filePaths.length);

main/ftb.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ async function ConvertFileToBinaryStream(filePath) {
148148
console.log('\nFile reading completed.');
149149
console.timeEnd("Processing Time");
150150
progressWorker.terminate();
151-
resolve(); // Resolve when processing is finished
151+
resolve();
152152
});
153153

154154
stream.on('error', (err) => {
155155
console.error('Error reading file:', err.message);
156-
reject(err); // Reject if there's an error
156+
reject(err);
157157
});
158158
});
159159
}
@@ -164,9 +164,9 @@ function getAllFiles(dirPath, filesArray = []) {
164164
files.forEach(file => {
165165
const fullPath = path.join(dirPath, file);
166166
if (fs.statSync(fullPath).isDirectory()) {
167-
getAllFiles(fullPath, filesArray); // Recursive call for subdirectories
167+
getAllFiles(fullPath, filesArray);
168168
} else {
169-
filesArray.push(fullPath); // Add full file path to the array
169+
filesArray.push(fullPath);
170170
}
171171
});
172172

0 commit comments

Comments
 (0)