cleaning up;bump version to 0.7.5

This commit is contained in:
huangjx
2022-02-23 15:49:40 +08:00
parent 684be80113
commit 5bfbeafea5
5 changed files with 2 additions and 86 deletions

View File

@@ -8,7 +8,7 @@ Search for torrents within the app from mutiple BT sites;
Control Aria2 and manage download tasks from the web; Control Aria2 and manage download tasks from the web;
download videos from 700+ video sites(youtube,youku,vimo,dailymotion,twitter,facebook and the likes download videos from 700+ video sites(youtube,youku,vimo,dailymotion,twitter,facebook and the likes
</description> </description>
<version>0.7.4</version> <version>0.7.5</version>
<licence>agpl</licence> <licence>agpl</licence>
<author mail="freefallbenson@gmail.com" homepage="https://github.com/shiningw">jiaxinhuang</author> <author mail="freefallbenson@gmail.com" homepage="https://github.com/shiningw">jiaxinhuang</author>
<namespace>NCDownloader</namespace> <namespace>NCDownloader</namespace>

View File

@@ -1,16 +0,0 @@
window.addEventListener('DOMContentLoaded', function () {
$('.ncdownloader-admin-settings').on('click', 'input[type="button"]', function (event) {
OC.msg.startSaving('#ncdownloader-message');
const target = $(this).attr("data-rel");
const http = $.ncdownloader.http;
let inputData = http.getData(target);
http.setData(inputData.data);
const path = inputData.url || "/apps/ncdownloader/admin/save";
let url = OC.generateUrl(path);
http.setUrl(url);
http.setHandler(function () {
OC.msg.finishedSuccess('#ncdownloader-message', "OK");
});
http.send();
});
});

View File

@@ -1,20 +0,0 @@
+(function ($) {
window.addEventListener("DOMContentLoaded", function () {
$('.ncdownloader-personal-settings').on('click', 'input[type="button"]', function (event) {
OC.msg.startSaving('#ncdownloader-message');
const target = $(this).attr("data-rel");
const http = $.ncdownloader.http;
let inputData = http.getData(target);
http.setData(inputData.data);
const path = inputData.url || "/apps/ncdownloader/personal/save";
let url = OC.generateUrl(path);
http.setUrl(url);
http.setHandler(function (data) {
OC.msg.finishedSuccess('#ncdownloader-message', "OK");
});
http.send();
});
});
}
)(jQuery)

View File

@@ -61,7 +61,7 @@ class Aria2
$this->setToken($this->tokenString); $this->setToken($this->tokenString);
$this->confDir = $conf_dir; $this->confDir = $conf_dir;
$this->sessionFile = $this->confDir . "/aria2.session"; $this->sessionFile = $this->confDir . "/aria2.session";
$this->confFile = $this->confDir . "/aria2.conf"; //$this->confFile = $this->confDir . "/aria2.conf";
$this->logFile = $this->confDir . "/aria2.log"; $this->logFile = $this->confDir . "/aria2.log";
} }
public function init() public function init()
@@ -96,9 +96,6 @@ class Aria2
if (!is_dir($this->confDir)) { if (!is_dir($this->confDir)) {
mkdir($this->confDir, 0755, true); mkdir($this->confDir, 0755, true);
} }
if (!file_exists($this->confDir . "/aria2.conf")) {
file_put_contents($this->confDir . "/aria2.conf", $this->confTemplate());
}
if (!is_dir($dir = $this->getDownloadDir())) { if (!is_dir($dir = $this->getDownloadDir())) {
mkdir($dir, 0755, true); mkdir($dir, 0755, true);
} }
@@ -405,39 +402,4 @@ class Aria2
sleep(3); sleep(3);
return $resp ?? null; return $resp ?? null;
} }
private function confTemplate()
{
return <<<EOF
continue
daemon=true
#dir=/home/aria2/Downloads
#file-allocation=falloc
log-level=info
max-connection-per-server=4
max-concurrent-downloads=5
max-overall-download-limit=0
min-split-size=5M
enable-http-pipelining=true
#interface=127.0.0.1
enable-rpc=true
rpc-secret=$this->tokenString
rpc-listen-all=true
rpc-listen-port=6800
follow-torrent=true
listen-port=51413
enable-dht=true
enable-peer-exchange=true
peer-id-prefix=-TR2770-
user-agent=Transmission/2.77
seed-ratio=0.1
bt-seed-unverified=true
max-overall-upload-limit=1M
#on-download-complete=
#on-download-error=
#on-download-start=
save-session=$this->sessionFile
input-file=$this->sessionFile
log=$this->logFile
EOF;
}
} }

View File

@@ -76,16 +76,6 @@ window.addEventListener('DOMContentLoaded', function () {
}).send(); }).send();
}) })
eventHandler.add("click", "#app-navigation", "#search-download", helper.showDownload); eventHandler.add("click", "#app-navigation", "#search-download", helper.showDownload);
eventHandler.add("change", "#app-navigation", "#ncd-hide-errors", e => {
let data = {};
data["ncd_hide_errors"] = e.target.checked;
const url = helper.generateUrl(basePath + "/personal/save");
Http.getInstance(url).setData(data).setHandler(resp => {
if (resp['message']) {
helper.message(t("ncdownloader", resp['message']), 1000);
}
}).send();
})
delegate('#app-ncdownloader-wrapper', delegate('#app-ncdownloader-wrapper',
{ target: '[data-tippy-content]' } { target: '[data-tippy-content]' }
); );