jely2002 / youtube-dl-gui

A cross-platform GUI for youtube-dl made in Electron and node.js
GNU Affero General Public License v3.0
6.5k stars 454 forks source link

Fixed show and open file #355

Closed Firefox0 closed 1 year ago

Firefox0 commented 2 years ago

305

The asynchronous function tried to show/open the file even when it was null and the program didn't look for the proper file yet. The promise makes sure the program will show/open the file once it completed the previous steps.

There were also occasions where the file had a string between the actual file name and the file extension like .f140 or .f251. I didn't look for the root cause but I included some code which fixes that issue temporarily.

Another issue was that the the file sometimes had the incorrect file extension. The program now looks for the file even if file was assigned video.filename and was not null to make sure we get the correct file extension afterwards.