Skip to content

Inconsistency in counting loaded tracks/files #67

@hajduakos

Description

@hajduakos

When dragging and dropping files, I observed the loading screen to say "240 loaded of 238". I think this inconsistency comes from the fact that the total is given by the number of files (numFiles):

<p>${numLoaded} loaded${failureString} of <b>${numFiles}</b></p>`;

but numLoaded is incremented for each track (and not for each file):

derive/src/ui.js

Lines 89 to 96 in ed9d902

const handleTrackFile = async (file) => {
for (const track of await extractTracks(file)) {
track.filename = file.name;
tracks.push(track);
map.addTrack(track);
modal.addSuccess();
}
};

So if there are files with multiple tracks, this inconsistency can occur that the number of loaded is more than the number of total.

Perhaps a quick fix would be to move modal.addSuccess(); out of the loop?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions