Additional fix for bug that caused server to crash when failing to update youtube-dl

pull/45/head
Isaac Grynsztein 6 years ago
parent 03e3eb9a81
commit d4664bad45

@ -655,6 +655,11 @@ async function autoUpdateYoutubeDL() {
let current_app_details = JSON.parse(fs.readFileSync(current_app_details_path)); let current_app_details = JSON.parse(fs.readFileSync(current_app_details_path));
let current_version = current_app_details['version']; let current_version = current_app_details['version'];
let stored_binary_path = current_app_details['path']; let stored_binary_path = current_app_details['path'];
if (!stored_binary_path || typeof stored_binary_path !== 'string') {
console.log(`Failed to get youtube-dl binary path at location: ${current_app_details_path}. Cancelling update check.`);
resolve(false);
return;
}
// got version, now let's check the latest version from the youtube-dl API // got version, now let's check the latest version from the youtube-dl API
let youtubedl_api_path = 'https://api.github.com/repos/ytdl-org/youtube-dl/tags'; let youtubedl_api_path = 'https://api.github.com/repos/ytdl-org/youtube-dl/tags';

Loading…
Cancel
Save