Added tests for arg generation and laid some plumbing for better arg simulation in the UI

This commit is contained in:
Isaac Abadi
2021-09-19 14:44:02 -04:00
parent 759637c1cf
commit a71d9f5c7e
3 changed files with 19 additions and 4 deletions

View File

@@ -190,7 +190,7 @@ async function collectInfo(download_uid) {
options.customFileFolderPath = user_path + path.sep;
}
let args = await generateArgs(url, type, options, download['user_uid']);
let args = await exports.generateArgs(url, type, options, download['user_uid']);
// get video info prior to download
let info = await getVideoInfoByURL(url, args, download_uid);
@@ -209,7 +209,7 @@ async function collectInfo(download_uid) {
if (category && category['custom_output']) {
options.customOutput = category['custom_output'];
options.noRelativePath = true;
args = await generateArgs(url, type, options, download['user_uid']);
args = await exports.generateArgs(url, type, options, download['user_uid']);
info = await getVideoInfoByURL(url, args, download_uid);
}
@@ -369,7 +369,7 @@ async function downloadQueuedFile(download_uid) {
// helper functions
async function generateArgs(url, type, options, user_uid = null) {
exports.generateArgs = async (url, type, options, user_uid = null) => {
const audioFolderPath = config_api.getConfigItem('ytdl_audio_folder_path');
const videoFolderPath = config_api.getConfigItem('ytdl_video_folder_path');