From c371287f23c0522cb27da3fefda71e4240bc2d16 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Fri, 4 May 2018 11:07:40 +0800 Subject: [PATCH] feat(torrents): show torrent info_hash in detail page --- modules/core/client/app/trans-string-en.js | 1 + modules/core/client/app/trans-string-zh.js | 1 + modules/torrents/client/views/view-torrent.client.view.html | 3 +++ .../torrents/server/controllers/torrents.server.controller.js | 2 ++ 4 files changed, 7 insertions(+) diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 31c31c42..7327596d 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -374,6 +374,7 @@ IMG_PAGE_INFO: 'Current: {{index}} / {{total}}', ANNOUNCE_URL: 'Announce Url', + TORRENT_INFO_HASH: 'Info Hash', TORRENT_FILENAME: 'Torrent Filename', ATTRIBUTE_TAGS: 'Video Attribute (tags)', VIDEO_NFO: 'Video NFO', diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 80682d2c..fe0aa9f2 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -374,6 +374,7 @@ IMG_PAGE_INFO: '当前页: {{index}} / {{total}}', ANNOUNCE_URL: 'Tracker 地址', + TORRENT_INFO_HASH: 'Hash 值', TORRENT_FILENAME: '种子文件名', ATTRIBUTE_TAGS: '视频属性(标签)', VIDEO_NFO: '视频 NFO', diff --git a/modules/torrents/client/views/view-torrent.client.view.html b/modules/torrents/client/views/view-torrent.client.view.html index 6b58b881..d3d16666 100644 --- a/modules/torrents/client/views/view-torrent.client.view.html +++ b/modules/torrents/client/views/view-torrent.client.view.html @@ -593,6 +593,9 @@
{{ 'ANNOUNCE_URL' | translate}}:
{{vm.torrentLocalInfo.torrent_announce}}
+
{{ 'TORRENT_INFO_HASH' | translate}}:
+
{{vm.torrentLocalInfo.info_hash}}
+
{{ 'TABLE_FIELDS.SEEDED' | translate}}:
{{vm.torrentLocalInfo.torrent_seeds}}
{{ 'TABLE_FIELDS.LEECHED' | translate}}:
diff --git a/modules/torrents/server/controllers/torrents.server.controller.js b/modules/torrents/server/controllers/torrents.server.controller.js index 5494effd..361ca634 100644 --- a/modules/torrents/server/controllers/torrents.server.controller.js +++ b/modules/torrents/server/controllers/torrents.server.controller.js @@ -225,6 +225,7 @@ exports.upload = function (req, res) { //the original tracker. var sourceInfo = config.meanTorrentConfig.announce.sourceInfo; torrent.metadata.info.sourceInfo = sourceInfo; + torrent.metadata.info.source = appConfig.name; var cws = fs.createWriteStream(newfile); cws.write(benc.encode(torrent.metadata)); @@ -528,6 +529,7 @@ exports.announceEdit = function (req, res) { //the original tracker. var sourceInfo = config.meanTorrentConfig.announce.sourceInfo; torrent.metadata.info.sourceInfo = sourceInfo; + torrent.metadata.info.source = appConfig.name; torrent_data = torrent.metadata; resolve();