diff --git a/server/services/Deluge/clientGatewayService.ts b/server/services/Deluge/clientGatewayService.ts index 34ce2f59..8d7723bb 100644 --- a/server/services/Deluge/clientGatewayService.ts +++ b/server/services/Deluge/clientGatewayService.ts @@ -286,6 +286,7 @@ class DelugeClientGatewayService extends ClientGatewayService { 'download_location', 'download_payload_rate', 'eta', + 'finished_time', 'message', 'name', 'num_peers', @@ -310,6 +311,8 @@ class DelugeClientGatewayService extends ClientGatewayService { .then(async (torrentsStatus) => { this.emit('PROCESS_TORRENT_LIST_START'); + const dateNowSeconds = Math.ceil(Date.now() / 1000); + const torrentList: TorrentList = Object.assign( {}, ...(await Promise.all( @@ -320,6 +323,8 @@ class DelugeClientGatewayService extends ClientGatewayService { bytesDone: status.total_done, dateAdded: status.time_added, dateCreated: 0, + dateFinished: + status.finished_time > 0 ? Math.ceil((dateNowSeconds - status.finished_time) / 10) * 10 : 0, directory: status.download_location, downRate: status.download_payload_rate, downTotal: status.total_payload_download, diff --git a/server/services/Deluge/types/DelugeCoreMethods.ts b/server/services/Deluge/types/DelugeCoreMethods.ts index 7f70649a..1df6fe96 100644 --- a/server/services/Deluge/types/DelugeCoreMethods.ts +++ b/server/services/Deluge/types/DelugeCoreMethods.ts @@ -104,7 +104,7 @@ export type DelugeCoreTorrentStorageMode = 'sparse' | 'allocate'; export interface DelugeCoreTorrentStatuses { active_time: unknown; seeding_time: unknown; - finished_time: unknown; + finished_time: number; all_time_download: unknown; storage_mode: DelugeCoreTorrentStorageMode; distributed_copies: unknown; diff --git a/server/services/Transmission/clientGatewayService.ts b/server/services/Transmission/clientGatewayService.ts index 9d604ae0..acfde38a 100644 --- a/server/services/Transmission/clientGatewayService.ts +++ b/server/services/Transmission/clientGatewayService.ts @@ -331,6 +331,7 @@ class TransmissionClientGatewayService extends ClientGatewayService { 'haveValid', 'addedDate', 'dateCreated', + 'doneDate', 'rateDownload', 'rateUpload', 'downloadedEver', @@ -365,6 +366,7 @@ class TransmissionClientGatewayService extends ClientGatewayService { bytesDone: torrent.haveValid, dateAdded: torrent.addedDate, dateCreated: torrent.dateCreated, + dateFinished: torrent.doneDate, directory: torrent.downloadDir, downRate: torrent.rateDownload, downTotal: torrent.downloadedEver, diff --git a/server/services/qBittorrent/clientGatewayService.ts b/server/services/qBittorrent/clientGatewayService.ts index f0fd90ad..1e2e787e 100644 --- a/server/services/qBittorrent/clientGatewayService.ts +++ b/server/services/qBittorrent/clientGatewayService.ts @@ -362,6 +362,7 @@ class QBittorrentClientGatewayService extends ClientGatewayService { bytesDone: info.completed, dateAdded: info.added_on, dateCreated, + dateFinished: info.completion_on, directory: info.save_path, downRate: info.dlspeed, downTotal: info.downloaded, diff --git a/server/services/rTorrent/clientGatewayService.ts b/server/services/rTorrent/clientGatewayService.ts index 4309e54f..3f6bdff9 100644 --- a/server/services/rTorrent/clientGatewayService.ts +++ b/server/services/rTorrent/clientGatewayService.ts @@ -651,6 +651,7 @@ class RTorrentClientGatewayService extends ClientGatewayService { bytesDone: response.bytesDone, dateAdded: response.dateAdded, dateCreated: response.dateCreated, + dateFinished: response.dateFinished, directory: response.directory, downRate: response.downRate, downTotal: response.downTotal, diff --git a/server/services/rTorrent/constants/methodCallConfigs/torrentList.ts b/server/services/rTorrent/constants/methodCallConfigs/torrentList.ts index 173d807c..fcd9925f 100644 --- a/server/services/rTorrent/constants/methodCallConfigs/torrentList.ts +++ b/server/services/rTorrent/constants/methodCallConfigs/torrentList.ts @@ -94,6 +94,10 @@ const torrentListMethodCallConfigs = { methodCall: 'd.creation_date=', transformValue: numberTransformer, }, + dateFinished: { + methodCall: 'd.timestamp.finished=', + transformValue: numberTransformer, + }, tags: { methodCall: 'd.custom1=', transformValue: (value: unknown): string[] => { diff --git a/shared/types/Torrent.ts b/shared/types/Torrent.ts index e39f5a1e..0db328fe 100644 --- a/shared/types/Torrent.ts +++ b/shared/types/Torrent.ts @@ -20,6 +20,7 @@ export interface TorrentProperties { bytesDone: number; dateAdded: number; dateCreated: number; + dateFinished: number; directory: string; downRate: number; downTotal: number;