Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency in counting loaded tracks/files #67

Open
hajduakos opened this issue Nov 6, 2022 · 1 comment
Open

Inconsistency in counting loaded tracks/files #67

hajduakos opened this issue Nov 6, 2022 · 1 comment
Assignees

Comments

@hajduakos
Copy link

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?

@erik
Copy link
Owner

erik commented Nov 7, 2022

Nice catch! Thanks for digging into the cause as well.

@erik erik self-assigned this Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants