diff --git a/app/torrent/[hash].tsx b/app/torrent/[hash].tsx index 4a87e37..a4a4f73 100644 --- a/app/torrent/[hash].tsx +++ b/app/torrent/[hash].tsx @@ -879,7 +879,7 @@ export default function TorrentDetail() { {torrent.eta > 0 && torrent.eta < 8640000 ? t('torrentDetail.remaining', { time: formatTime(torrent.eta) }) - : progress >= 100 + : torrent.progress >= 1 ? t('torrentDetail.complete') : '∞'} @@ -967,7 +967,7 @@ export default function TorrentDetail() { `${torrent.num_leechs || 0} / ${torrent.num_incomplete || 0}`, handleOpenPeerDetails, ), - staticRow(t('torrentDetail.availability'), torrent.availability ? torrent.availability.toFixed(2) : '0.00'), + staticRow(t('torrentDetail.availability'), torrent.availability ? (Math.floor(torrent.availability * 1000) / 1000).toFixed(3) : '0.000'), ])} @@ -1121,7 +1121,7 @@ export default function TorrentDetail() { style={[styles.peerRow, { borderBottomColor: colors.surfaceOutline }]} > - {(p.progress * 100).toFixed(1)}% + {(Math.floor(p.progress * 1000) / 10).toFixed(1)}% diff --git a/app/torrent/files.tsx b/app/torrent/files.tsx index b8aef7b..bc38d21 100644 --- a/app/torrent/files.tsx +++ b/app/torrent/files.tsx @@ -525,7 +525,7 @@ export default function TorrentFilesScreen() { - {(file.progress * 100).toFixed(1)}% + {(Math.floor(file.progress * 1000) / 10).toFixed(1)}% diff --git a/components/TorrentCard.tsx b/components/TorrentCard.tsx index ec687ae..7e6e998 100644 --- a/components/TorrentCard.tsx +++ b/components/TorrentCard.tsx @@ -108,7 +108,7 @@ function TorrentCardInner({ const statusLine = [ stateLabel, speedText, - `${progress.toFixed(0)}%`, + `${Math.floor(progress)}%`, hasEta ? formatTime(torrent.eta) : null, ].filter(Boolean).join(' · '); @@ -191,7 +191,7 @@ function TorrentCardInner({ {show('progress') && ( )} {show('dlSpeed') && dlspeed > 0 && ( @@ -236,10 +236,10 @@ function TorrentCardInner({ value={formatSize(torrent.uploaded)} /> )} - {show('availability') && torrent.availability > 0 && torrent.availability < 1 && ( + {show('availability') && torrent.availability > 0 && ( )} {show('seedingTime') && torrent.seeding_time > 0 && ( diff --git a/components/TorrentDetails.tsx b/components/TorrentDetails.tsx index 2586877..67905e5 100644 --- a/components/TorrentDetails.tsx +++ b/components/TorrentDetails.tsx @@ -1124,7 +1124,7 @@ export function TorrentDetails({ style={[styles.peerRow, { borderBottomColor: colors.surfaceOutline }]} > - {(p.progress * 100).toFixed(1)}% + {(Math.floor(p.progress * 1000) / 10).toFixed(1)}% @@ -1151,7 +1151,7 @@ export function TorrentDetails({ {t('torrentDetail.generalInformation')} - + @@ -1402,7 +1402,7 @@ export function TorrentDetails({ {formatSize(file.size)} - {(file.progress * 100).toFixed(1)}% + {(Math.floor(file.progress * 1000) / 10).toFixed(1)}%