Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions assets/app/js/aboutCodeDB.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ class AboutCodeDB {
const version = aboutCodeVersion;
let headerId = null;
let files_count = null;
let dirs_count = null;
let index = 0;
let rootPath = null;
let hasRootPath = false;
Expand Down Expand Up @@ -223,6 +224,11 @@ class AboutCodeDB {
if (rootPath === file.path) {
hasRootPath = true;
}
// TODO: When/if scancode reports directories in its header, this needs
// to be replaced.
if (index === 0) {
dirs_count = file.dirs_count;
}
file.id = index++;
files.push(file);
if (files.length >= batchSize) {
Expand All @@ -231,12 +237,12 @@ class AboutCodeDB {
promiseChain = promiseChain
.then(() => that._batchCreateFiles(files, headerId))
.then(() => {
const currProgress = Math.round(index / files_count * 100);
const currProgress = Math.round(index / (files_count + dirs_count) * 100);
if (currProgress > progress) {
progress = currProgress;
onProgressUpdate(progress);
console.log('Progress: ' + `${progress}% ` +
`(${index}/${files_count})`);
`(${index}/(${files_count}+${dirs_count}))`);
}
})
.then(() => {
Expand Down