changed default polling interval to 1.5s;added wrapper function for polling youtube downloads

This commit is contained in:
huangjx
2022-04-24 14:00:46 +08:00
parent 1cf4f4a00b
commit 0a9bcb606d
3 changed files with 15 additions and 12 deletions

View File

@@ -7,7 +7,6 @@ import { translate as t, translatePlural as n } from '@nextcloud/l10n'
import contentTable from '../lib/contentTable';
import Http from '../lib/http'
import Polling from "../lib/polling";
const helper = {
vue: {},
addVue(name, object) {
@@ -26,7 +25,7 @@ const helper = {
disablePolling() {
Polling.create().disable().clear();
},
polling(delay = 1000, path) {
polling(delay = 1500, path) {
Polling.create().setDelay(delay).run(helper.refresh, path);
},
scanFolder(path = "/apps/ncdownloader/scanfolder") {
@@ -37,9 +36,12 @@ const helper = {
}).send();
});
},
pollingFolder(delay = 1000) {
pollingFolder(delay = 1500) {
Polling.create().setDelay(delay).run(helper.scanFolder);
},
pollingYoutube(delay = 1500) {
Polling.create().setDelay(delay).run(helper.refresh, "/apps/ncdownloader/youtube/get");
},
refresh(path) {
path = path || "/apps/ncdownloader/status/active";
let url = helper.generateUrl(path);