feat: utilisation des bar de telechargement par fichier dans le torrent plutot que celui du torrent

This commit is contained in:
MasutaYunikon committed 2026-04-21 15:53:39 +02:00
1 parent 4955a730b7
commit 7e53bab0fc
6 files changed
+87 -26

No files matched your search

+7
View File
@@ -96,6 +96,7 @@ const TR: TorrentClientDriver = {
'hashString', 'name', 'status', 'percentDone', 'totalSize',
'downloadedEver', 'uploadedEver', 'uploadRatio',
'rateDownload', 'rateUpload', 'eta', 'downloadDir', 'labels',
'fileStats', // progression par fichier (bytesCompleted + length)
]
const data = await trRequest(config, 'torrent-get', { fields })
const torrents: any[] = data.arguments?.torrents ?? []
@@ -119,6 +120,12 @@ const TR: TorrentClientDriver = {
eta : t.eta ?? -1,
save_path : t.downloadDir,
category : t.labels?.[0] ?? '',
files : Array.isArray(t.fileStats) && t.fileStats.length > 0
? t.fileStats.map((fs: any, i: number) => ({
index : i,
progress: fs.length > 0 ? Math.round((fs.bytesCompleted / fs.length) * 100) : 0,
}))
: undefined,
} satisfies TorrentInfo))
},