Fix missing speed on SAB cards and remove incorrect missing pieces display
All checks were successful
All checks were successful
This commit is contained in:
@@ -865,8 +865,8 @@ function createDownloadCard(download) {
|
|||||||
progressText.textContent = download.progress + '%';
|
progressText.textContent = download.progress + '%';
|
||||||
valueDiv.appendChild(progressText);
|
valueDiv.appendChild(progressText);
|
||||||
|
|
||||||
// Missing pieces text
|
// Missing pieces text (only for torrent clients like qBittorrent)
|
||||||
if (missingMb > 0 && totalMb > 0) {
|
if (download.client && (download.client === 'qbittorrent' || download.client === 'rtorrent') && missingMb > 0 && totalMb > 0) {
|
||||||
const missingText = document.createElement('span');
|
const missingText = document.createElement('span');
|
||||||
missingText.className = 'missing-text';
|
missingText.className = 'missing-text';
|
||||||
missingText.textContent = `(missing ${missingMb.toFixed(1)} of ${totalMb.toFixed(1)} MB)`;
|
missingText.textContent = `(missing ${missingMb.toFixed(1)} of ${totalMb.toFixed(1)} MB)`;
|
||||||
@@ -878,7 +878,7 @@ function createDownloadCard(download) {
|
|||||||
details.appendChild(progressItem);
|
details.appendChild(progressItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (download.speed) {
|
if (download.speed !== undefined && download.speed !== null) {
|
||||||
const speed = createDetailItem('Speed', download.speed);
|
const speed = createDetailItem('Speed', download.speed);
|
||||||
details.appendChild(speed);
|
details.appendChild(speed);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user