danielnieto / electron-download-manager

Manage downloadItems from Electron's BrowserWindows without user interaction, allowing single file download and bulk downloading
MIT License
120 stars 50 forks source link

Issues when using bulkDownload #4

Closed simone-liore closed 7 years ago

simone-liore commented 7 years ago

Hi. I've been using this module for a little bit. It used to work alright. Now somethin weird is happening. The files get downloaded no problem. After that I used to rewrite their names and be done with them. Now, even after removing all of my custom code, the callback never gets called, even tho the files are downloaded. I changed the whole callback to the documentation one. Yet no callback. Any ideas?

remote.require("electron-download-manager").bulkDownload({
                            urls: offline_playlist_url,
                        }, function (error, finished, errors) {
                            if (error) {
                                console.log("finished: " + finished);
                                console.log("errors: " + errors);
                                return;
                            }

                            console.log("all finished");
                        })

Returns no console.log

danielnieto commented 7 years ago

I just published a new version of npm package 1.3.1, please update it, it should fix your problem.

Recently we've rolled out a new feature which allows electron-download-manager to resume failed downloads, but the first PR didn't include a finished download callback for if a file already existed on the disk, I didn't realized it, and I (unknowingly) published an update to NPM with this flaw, later, the original author of this feature sent another PR adding the callback, and I forgot to publish it to NPM so, version 1.3.0 is flawed.

Please update your NPM package to latest version (1.3.1) and let me know if your issue is solved