LibriVox / librivox-catalog

LibriVox catalog and reader workflow application
https://librivox.org
MIT License
37 stars 17 forks source link

Issue/#39 #174

Closed hamidsafdari closed 9 months ago

hamidsafdari commented 10 months ago

Fix validator uploading one file at a time.

hamidsafdari commented 10 months ago

Stating the obvious here, but the changes were made to the JavaScript code and might need a hard refresh (Ctrl+F5). It also sometimes helps to manually clear the cache:

notartom commented 10 months ago

I did try a hard refresh, though I acknowledge that Firefox is sometimes weird with cache. I've had more predictable results with Chromium, so I can try again with that. Will report back.

hamidsafdari commented 10 months ago

Also, I've kept this PR in draft mode because a refresh is needed after all the files are uploaded to render the file data. However, I do see some error when uploading some .mp3 files (unknown characters in filename and application/octet-stream as the MIME) but because the page reloads after all the files are uploaded, the errors are lost.

I intend to show a dialog to the user with the list of files that had a problem and reload the page when the user closes or clicks on OK.

hamidsafdari commented 10 months ago

There is a callback called stop that Blueimp (the file upload library) calls after all uploads are done. I removed my old code and used that instead. Also, the errors are not passed to the stop callback. I had to collect them in a variable outside and use it in stop.

To be consistent, I styled the upload result dialog after jQuery UI since it's also shown when editing the file fields. The alternative would be to use the Bootstrap modal styling.

With errors:

validator-with-error.webm

Without errors:

validator-with-no-error.webm

notartom commented 9 months ago

As mentioned in https://github.com/LibriVox/librivox-catalog/pull/175#issuecomment-1848828336 and https://github.com/LibriVox/librivox-catalog/pull/175#issuecomment-1848992764, looks like you've lost hope with my slow turnaround time for reviews and have moved on to bigger and better things. Because this is a fairly big PR, I'm not in a position to review it and make the adjustments myself. I'm going to close this. If you decide you want to come back, by all means reopen this PR.