save download path in database
This commit is contained in:
@@ -22,7 +22,8 @@ export default {
|
||||
}
|
||||
let data = { ncd_downloader_dir: path };
|
||||
let url = helper.generateUrl("/apps/ncdownloader/personal/save");
|
||||
helper.httpClient(url)
|
||||
helper
|
||||
.httpClient(url)
|
||||
.setData(data)
|
||||
.setHandler((data) => {
|
||||
if (data.status) {
|
||||
@@ -31,7 +32,10 @@ export default {
|
||||
})
|
||||
.send();
|
||||
};
|
||||
helper.filepicker(cb);
|
||||
let dlPath = element.hasAttribute("data-path")
|
||||
? element.getAttribute("data-path")
|
||||
: undefined;
|
||||
helper.filepicker(cb, dlPath);
|
||||
},
|
||||
},
|
||||
props: ["path"],
|
||||
|
||||
@@ -10,6 +10,7 @@ import aria2Options from './utils/aria2Options';
|
||||
import { options as ytdFullOptions, names as ytdOptions } from './utils/youtubedlOptions';
|
||||
import helper from './utils/helper';
|
||||
import './css/autoComplete.css'
|
||||
import './css/settings.scss'
|
||||
'use strict';
|
||||
import { delegate } from 'tippy.js';
|
||||
import 'tippy.js/dist/tippy.css';
|
||||
|
||||
@@ -287,13 +287,15 @@ const helper = {
|
||||
container.setAttribute("type", name);
|
||||
container.className = "table " + name;
|
||||
},
|
||||
filepicker(cb) {
|
||||
filepicker(cb,currentPath) {
|
||||
OC.dialogs.filepicker(
|
||||
t('ncdownloader', 'Select a directory'),
|
||||
cb,
|
||||
false,
|
||||
'httpd/unix-directory',
|
||||
true
|
||||
true,
|
||||
OC.dialogs.FILEPICKER_TYPE_CHOOSE,
|
||||
currentPath
|
||||
);
|
||||
},
|
||||
getSettings(key, defaultValue = null, type = 2) {
|
||||
|
||||
Reference in New Issue
Block a user