From 3d4971f89e8b0f7f9708c37041e960e60a449eb0 Mon Sep 17 00:00:00 2001 From: imebeh Date: Mon, 23 Mar 2020 01:40:01 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A3=81=E5=8A=9B?= =?UTF-8?q?=E9=93=BE=E4=BB=BB=E5=8A=A1=E4=B8=8D=E6=9B=B4=E6=96=B0=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 活跃任务信息增加 `name`、`totalSize` 字段 2. 是否更新更多的任务信息根据文件列表是否为空来判断 --- src/tr-web-control/script/system.js | 4 +++- src/tr-web-control/script/transmission.torrents.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tr-web-control/script/system.js b/src/tr-web-control/script/system.js index 8af1a8e..64753b4 100644 --- a/src/tr-web-control/script/system.js +++ b/src/tr-web-control/script/system.js @@ -2595,7 +2595,9 @@ var system = { } torrent.completeSize = (torrent.totalSize - torrent.leftUntilDone); - torrent.moreInfosTag = true; + if (("files" in torrent) && torrent.files.length > 0) { + torrent.moreInfosTag = true; + } system.fillTorrentBaseInfos(torrent); system.fillTorrentFileList(torrent); system.fillTorrentServerList(torrent); diff --git a/src/tr-web-control/script/transmission.torrents.js b/src/tr-web-control/script/transmission.torrents.js index cb54c03..d6f5251 100644 --- a/src/tr-web-control/script/transmission.torrents.js +++ b/src/tr-web-control/script/transmission.torrents.js @@ -16,7 +16,7 @@ transmission.torrents = { pausedTorrentCount: 0, fields: { base: "id,name,status,hashString,totalSize,percentDone,addedDate,trackerStats,leftUntilDone,rateDownload,rateUpload,recheckProgress" + ",rateDownload,rateUpload,peersGettingFromUs,peersSendingToUs,uploadRatio,uploadedEver,downloadedEver,downloadDir,error,errorString,doneDate,queuePosition,activityDate", - status: "id,status,percentDone,trackerStats,leftUntilDone,rateDownload,rateUpload" + ",rateDownload,rateUpload,peersGettingFromUs,peersSendingToUs,uploadRatio,uploadedEver,downloadedEver,error,errorString,doneDate,queuePosition,activityDate", + status: "id,name,status,totalSize,percentDone,trackerStats,leftUntilDone,rateDownload,rateUpload" + ",rateDownload,rateUpload,peersGettingFromUs,peersSendingToUs,uploadRatio,uploadedEver,downloadedEver,error,errorString,doneDate,queuePosition,activityDate", config: "downloadLimit,downloadLimited,peer-limit,seedIdleLimit,seedIdleMode,seedRatioLimit,seedRatioMode,uploadLimit,uploadLimited" }, // List of all the torrents that have been acquired From f7db3d966b65dfa06a97a8697e8abc8ab19c131f Mon Sep 17 00:00:00 2001 From: imebeh Date: Wed, 25 Mar 2020 01:30:14 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=8D=95=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=BB=BB=E5=8A=A1=E6=94=B9=E5=90=8D=E5=90=8E=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tr-web-control/template/dialog-torrent-rename.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tr-web-control/template/dialog-torrent-rename.html b/src/tr-web-control/template/dialog-torrent-rename.html index 1047718..2405b89 100644 --- a/src/tr-web-control/template/dialog-torrent-rename.html +++ b/src/tr-web-control/template/dialog-torrent-rename.html @@ -65,6 +65,7 @@ return; } + torrent.moreInfosTag = false; system.reloadTorrentBaseInfos(data.arguments.id, ["name"]); thisDialog.dialog("close"); } From 65cbf1500957fd8c73bb4991f6c4aaa54b310163 Mon Sep 17 00:00:00 2001 From: imebeh Date: Wed, 25 Mar 2020 02:17:45 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E7=A3=81=E5=8A=9B?= =?UTF-8?q?=E9=93=BE=E4=BB=BB=E5=8A=A1=E7=8A=B6=E6=80=81=E7=9A=84=E6=84=9F?= =?UTF-8?q?=E5=8F=B9=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tr-web-control/script/transmission.torrents.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tr-web-control/script/transmission.torrents.js b/src/tr-web-control/script/transmission.torrents.js index d6f5251..ed15962 100644 --- a/src/tr-web-control/script/transmission.torrents.js +++ b/src/tr-web-control/script/transmission.torrents.js @@ -296,7 +296,11 @@ transmission.torrents = { } if (warnings.length == trackerStats.length) { - item["warning"] = warnings.join(";"); + if ((warnings.join(";")).replace(/;/g,"") == ""){ + item["warning"] = "" + } else { + item["warning"] = warnings.join(";"); + } // 设置下次更新时间 if (!item["nextAnnounceTime"]) item["nextAnnounceTime"] = trackerInfo.nextAnnounceTime; From 1fe7dc98d8a76118f79a6701df4856a20a1c33c9 Mon Sep 17 00:00:00 2001 From: imebeh Date: Wed, 25 Mar 2020 02:44:32 +0800 Subject: [PATCH 4/6] =?UTF-8?q?Revert=20"=E4=BF=AE=E5=A4=8D=20=E7=A3=81?= =?UTF-8?q?=E5=8A=9B=E9=93=BE=E4=BB=BB=E5=8A=A1=E7=8A=B6=E6=80=81=E7=9A=84?= =?UTF-8?q?=E6=84=9F=E5=8F=B9=E5=8F=B7"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 65cbf1500957fd8c73bb4991f6c4aaa54b310163. --- src/tr-web-control/script/transmission.torrents.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/tr-web-control/script/transmission.torrents.js b/src/tr-web-control/script/transmission.torrents.js index ed15962..d6f5251 100644 --- a/src/tr-web-control/script/transmission.torrents.js +++ b/src/tr-web-control/script/transmission.torrents.js @@ -296,11 +296,7 @@ transmission.torrents = { } if (warnings.length == trackerStats.length) { - if ((warnings.join(";")).replace(/;/g,"") == ""){ - item["warning"] = "" - } else { - item["warning"] = warnings.join(";"); - } + item["warning"] = warnings.join(";"); // 设置下次更新时间 if (!item["nextAnnounceTime"]) item["nextAnnounceTime"] = trackerInfo.nextAnnounceTime; From c1c2437a28dff69e0329c710cebb9ba3d2172e38 Mon Sep 17 00:00:00 2001 From: imebeh Date: Wed, 25 Mar 2020 02:46:19 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E7=A3=81=E5=8A=9B?= =?UTF-8?q?=E9=93=BE=E4=BB=BB=E5=8A=A1=E7=8A=B6=E6=80=81=E7=9A=84=E6=84=9F?= =?UTF-8?q?=E5=8F=B9=E5=8F=B7=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tr-web-control/script/transmission.torrents.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tr-web-control/script/transmission.torrents.js b/src/tr-web-control/script/transmission.torrents.js index d6f5251..4cebc0d 100644 --- a/src/tr-web-control/script/transmission.torrents.js +++ b/src/tr-web-control/script/transmission.torrents.js @@ -296,7 +296,11 @@ transmission.torrents = { } if (warnings.length == trackerStats.length) { - item["warning"] = warnings.join(";"); + if ((warnings.join(";")).replace(/;/g,"") == ""){ + item["warning"] = ""; + } else { + item["warning"] = warnings.join(";"); + } // 设置下次更新时间 if (!item["nextAnnounceTime"]) item["nextAnnounceTime"] = trackerInfo.nextAnnounceTime; From 8cfc8bd8f9a5194915b7d4e72bf7c509483f8601 Mon Sep 17 00:00:00 2001 From: imebeh Date: Wed, 25 Mar 2020 04:07:27 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9B=AE=E5=BD=95=E4=B8=BA=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E5=80=99=E9=80=89=E4=B8=8B=E8=BD=BD=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tr-web-control/script/system.js | 4 ++++ src/tr-web-control/template/dialog-torrent-add.html | 6 ++++++ src/tr-web-control/template/dialog-torrent-addfile.html | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/src/tr-web-control/script/system.js b/src/tr-web-control/script/system.js index 64753b4..1d53604 100644 --- a/src/tr-web-control/script/system.js +++ b/src/tr-web-control/script/system.js @@ -85,6 +85,8 @@ var system = { checkedRows: [], uiIsInitialized: false, popoverCount: 0, + // 当前数据目录,用于添加任务的快速保存路径选择 + currentListDir: "", /** * 设置语言 */ @@ -636,6 +638,7 @@ var system = { system.loadTorrentToList({ node: node }); + system.currentListDir = node.downDir; }, lines: true }); @@ -3000,6 +3003,7 @@ var system = { this.appendTreeNode(parentkey, [{ id: key, path: path, + downDir: fullkey, text: text, iconCls: "iconfont tr-icon-file" }]); diff --git a/src/tr-web-control/template/dialog-torrent-add.html b/src/tr-web-control/template/dialog-torrent-add.html index 8ee4961..31e0044 100644 --- a/src/tr-web-control/template/dialog-torrent-add.html +++ b/src/tr-web-control/template/dialog-torrent-add.html @@ -80,6 +80,12 @@ $.merge(downloadDirs,system.dictionary.folders.split("\n")); } downloadDirs = uniq(downloadDirs); + + if (system.config.hideSubfolders == false && system.currentListDir != null && system.currentListDir != "") { + // 增加 当前数据目录为第一候选 + downloadDirs.unshift(system.currentListDir); + } + if (downloadDirs == null) { $("