removed downloaded and total mb
This commit is contained in:
@@ -393,6 +393,7 @@ class QueueManager {
|
||||
// Extract progress information - handle both ProgressService and yt-dlp formats
|
||||
const progress = data.progress || data;
|
||||
const percent = progress.percent || 0;
|
||||
const metadata = progress.metadata || data.metadata || {};
|
||||
|
||||
// Check if we have detailed yt-dlp progress (downloaded_mb, total_mb, speed_mbps)
|
||||
// or basic ProgressService progress (current, total)
|
||||
@@ -407,12 +408,13 @@ class QueueManager {
|
||||
// ProgressService basic format - convert bytes to MB
|
||||
downloaded = (progress.current / (1024 * 1024)).toFixed(1);
|
||||
total = progress.total > 0 ? (progress.total / (1024 * 1024)).toFixed(1) : 'Unknown';
|
||||
speed = '0.0'; // Speed not available in basic format
|
||||
// Check for speed in metadata
|
||||
speed = metadata.speed_mbps ? metadata.speed_mbps.toFixed(1) : '0.0';
|
||||
} else {
|
||||
// Fallback
|
||||
downloaded = '0.0';
|
||||
total = 'Unknown';
|
||||
speed = '0.0';
|
||||
speed = metadata.speed_mbps ? metadata.speed_mbps.toFixed(1) : '0.0';
|
||||
}
|
||||
|
||||
// Update progress bar
|
||||
@@ -428,7 +430,7 @@ class QueueManager {
|
||||
const speedSpan = progressInfo.querySelector('.download-speed');
|
||||
|
||||
if (percentSpan) {
|
||||
percentSpan.textContent = `${percent.toFixed(1)}% (${downloaded} MB / ${total} MB)`;
|
||||
percentSpan.textContent = percent > 0 ? `${percent.toFixed(1)}%` : 'Starting...';
|
||||
}
|
||||
if (speedSpan) {
|
||||
speedSpan.textContent = `${speed} MB/s`;
|
||||
@@ -487,8 +489,8 @@ class QueueManager {
|
||||
const progress = download.progress || {};
|
||||
const progressPercent = progress.percent || 0;
|
||||
const speed = progress.speed_mbps ? `${progress.speed_mbps.toFixed(1)} MB/s` : '0 MB/s';
|
||||
const downloaded = progress.downloaded_mb ? `${progress.downloaded_mb.toFixed(1)} MB` : '0 MB';
|
||||
const total = progress.total_mb ? `${progress.total_mb.toFixed(1)} MB` : 'Unknown';
|
||||
const downloaded = progress.downloaded_mb ? `${progress.downloaded_mb.toFixed(1)} MB` : '0.0';
|
||||
const total = progress.total_mb ? `${progress.total_mb.toFixed(1)} MB` : '0.0';
|
||||
|
||||
return `
|
||||
<div class="download-card active" data-download-id="${download.id}">
|
||||
@@ -503,7 +505,7 @@ class QueueManager {
|
||||
<div class="progress-fill" style="width: ${progressPercent}%"></div>
|
||||
</div>
|
||||
<div class="progress-info">
|
||||
<span>${progressPercent.toFixed(1)}% (${downloaded} / ${total})</span>
|
||||
<span>${progressPercent > 0 ? `${progressPercent.toFixed(1)}%` : 'Starting...'}</span>
|
||||
<span class="download-speed">${speed}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user