You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-26 14:11:59 +01:00
Not sure which has better code, firmware, or this? This is okay, but toy lang. Firmware was horrible.
This commit is contained in:
@@ -11,11 +11,8 @@ function checkFFmpeg() {
|
||||
});
|
||||
|
||||
checkFFmpegProcess.on('exit', (code) => {
|
||||
if (code === 0) {
|
||||
resolve('ffmpeg');
|
||||
} else {
|
||||
resolve(require('ffmpeg-static'));
|
||||
}
|
||||
if (code === 0) resolve('ffmpeg');
|
||||
else resolve(require('ffmpeg-static'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -74,9 +74,7 @@ function parseAudioDevice(options, callback) {
|
||||
if (platform === 'win32' && line.search(/Alternative\sname/) > -1) {
|
||||
const lastDevice = deviceList[deviceList.length - 1];
|
||||
const alt = line.match(alternativeName);
|
||||
if (lastDevice && alt) {
|
||||
lastDevice.alternativeName = alt[1];
|
||||
}
|
||||
if (lastDevice && alt) lastDevice.alternativeName = alt[1];
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -107,11 +105,8 @@ function parseAudioDevice(options, callback) {
|
||||
}
|
||||
};
|
||||
|
||||
if (callbackExists) {
|
||||
execute();
|
||||
} else {
|
||||
return new Promise(execute);
|
||||
}
|
||||
if (callbackExists) execute();
|
||||
else return new Promise(execute);
|
||||
}
|
||||
|
||||
module.exports = { parseAudioDevice };
|
||||
Reference in New Issue
Block a user