Skip to content

Commit

Permalink
🐛 Fixed oblique path errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Powerm1nt committed Oct 27, 2023
1 parent e73a83c commit 826bd5f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Common/Utils.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import fs from 'fs'
import * as path from 'path'

function listFilesRecursively (directory) {
function listFilesRecursively(directory) {
let fileList = []

for (const element of directory) {
const fullPath = path.join(element)
const stats = fs.statSync(fullPath)
const fullPath = path.join(element).replace(/\\/g, '/');
const stats = fs.statSync(fullPath);
if (stats.isDirectory()) {
fileList = fileList.concat(listFilesRecursively(fs.readdirSync(fullPath).map(file => path.join(fullPath, file))))
fileList = fileList.concat(listFilesRecursively(fs.readdirSync(fullPath).map(file => (path.join(fullPath, file)).replace(/\\/g, '/')));
} else if (stats.isFile()) {
fileList.push(fullPath)
fileList.push(fullPath);
}
}

return fileList
return fileList;
}


function calculateBitrate (bytesDownloaded, downloadTimeSeconds) {
// Calculate the bitrate in bytes per second
const bytesPerSecond = bytesDownloaded / downloadTimeSeconds
Expand Down

0 comments on commit 826bd5f

Please sign in to comment.