start polling once downloads initiated

This commit is contained in:
huangjx
2022-04-24 15:50:09 +08:00
parent 507b43ca3b
commit 58a0be2319
2 changed files with 10 additions and 5 deletions

View File

@@ -58,6 +58,10 @@ export default {
let formData = helper.getData(formWrapper); let formData = helper.getData(formWrapper);
let inputValue = formData["text-input-value"].trim(); let inputValue = formData["text-input-value"].trim();
let message; let message;
if (!helper.isURL(inputValue) && !helper.isMagnetURI(inputValue)) {
helper.error(t("ncdownloader", inputValue + " is Invalid"));
return;
}
if (formData.type === "youtube-dl") { if (formData.type === "youtube-dl") {
formData["audio-only"] = ""; formData["audio-only"] = "";
formData["extension"] = ""; formData["extension"] = "";
@@ -68,10 +72,11 @@ export default {
} }
} }
message = helper.t("Download task started!"); message = helper.t("Download task started!");
} helper.pollingYoutube();
if (!helper.isURL(inputValue) && !helper.isMagnetURI(inputValue)) { helper.setContentTableType("youtube-dl-downloads");
helper.error(t("ncdownloader", inputValue + " is Invalid")); } else {
return; helper.polling();
helper.setContentTableType("active-downloads");
} }
if (message) { if (message) {
helper.info(message); helper.info(message);

View File

@@ -7,7 +7,7 @@ export default {
event.stopPropagation(); event.stopPropagation();
event.preventDefault(); event.preventDefault();
let element = event.target; let element = event.target;
helper.hideDownload(); //helper.hideDownload();
let currentType = helper.getContentTableType(); let currentType = helper.getContentTableType();
let path = element.getAttribute("path"); let path = element.getAttribute("path");
let name = element.getAttribute("id"); let name = element.getAttribute("id");