From a6b855f0f0a12b11e14e47b862541fc3e32f358d Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Wed, 23 Dec 2020 21:59:33 +0800 Subject: [PATCH] server: rTorrent: don't mix rTorrent response with API response --- .../services/rTorrent/clientGatewayService.ts | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/server/services/rTorrent/clientGatewayService.ts b/server/services/rTorrent/clientGatewayService.ts index d8154642..4f18da5d 100644 --- a/server/services/rTorrent/clientGatewayService.ts +++ b/server/services/rTorrent/clientGatewayService.ts @@ -629,10 +629,31 @@ class RTorrentClientGatewayService extends ClientGatewayService { ...(await Promise.all( processedResponses.map(async (response) => { const torrentProperties: TorrentProperties = { - ...response, - status: getTorrentStatusFromProperties(response), - percentComplete: getTorrentPercentCompleteFromProperties(response), + bytesDone: response.bytesDone, + dateAdded: response.dateAdded, + dateCreated: response.dateCreated, + directory: response.directory, + downRate: response.downRate, + downTotal: response.downTotal, eta: getTorrentETAFromProperties(response), + hash: response.hash, + isPrivate: response.isPrivate, + isSequential: response.isSequential, + message: response.message, + name: response.name, + peersConnected: response.peersConnected, + peersTotal: response.peersTotal, + percentComplete: getTorrentPercentCompleteFromProperties(response), + priority: response.priority, + ratio: response.ratio, + seedsConnected: response.seedsConnected, + seedsTotal: response.seedsTotal, + sizeBytes: response.sizeBytes, + status: getTorrentStatusFromProperties(response), + tags: response.tags, + trackerURIs: response.trackerURIs, + upRate: response.upRate, + upTotal: response.upTotal, }; this.emit('PROCESS_TORRENT', torrentProperties);