added option for copying links in aria2 downloads too

This commit is contained in:
huangjx
2022-02-20 18:00:51 +08:00
parent 06e1588d06
commit d5014f59ee

View File

@@ -186,6 +186,7 @@ class Aria2Controller extends Controller
if ($row = $this->dbconn->getByGid($gid)) { if ($row = $this->dbconn->getByGid($gid)) {
$filename = $row['filename']; $filename = $row['filename'];
$timestamp = $row['timestamp']; $timestamp = $row['timestamp'];
$extra = unserialize($row['data']);
} else if (isset($value['files'][0]['path'])) { } else if (isset($value['files'][0]['path'])) {
$parts = explode("/", ($path = $value['files'][0]['path'])); $parts = explode("/", ($path = $value['files'][0]['path']));
if (count($parts) > 1) { if (count($parts) > 1) {
@@ -234,12 +235,12 @@ class Aria2Controller extends Controller
$tmp = []; $tmp = [];
$actions = []; $actions = [];
$filename = sprintf('<a class="download-file-folder" href="%s">%s</a>', $folderLink, $filename); $filename = sprintf('<a class="download-file-folder" href="%s">%s</a>', $folderLink, $filename);
$fileInfo = sprintf("%s | %s", $total, date("Y-m-d H:i:s", $timestamp)); $fileInfo = sprintf('<button id="icon-clipboard" class="icon-clipboard" data-text="%s"></button> %s | %s', $extra ? $extra['link'] : 'nolink', $total, date("Y-m-d H:i:s", $timestamp));
$tmp['filename'] = array($filename, $fileInfo); $tmp['filename'] = array($filename, $fileInfo);
if ($this->aria2->methodName === "tellStopped") { if ($this->aria2->methodName === "tellStopped") {
$actions[] = $this->createActionItem('purge', 'purge'); $actions[] = $this->createActionItem('purge', 'purge');
} }
if ($this->aria2->methodName === "tellWaiting") { if ($this->aria2->methodName === "tellWaiting") {
$actions[] = $this->createActionItem('unpause', 'unpause'); $actions[] = $this->createActionItem('unpause', 'unpause');
$actions[] = $this->createActionItem('delete', 'remove'); $actions[] = $this->createActionItem('delete', 'remove');