Saves: paint progress only on Downloads rows, not on search/playlist cards

Every card of a video carries .downloading while it saves, so the progress
painter rewrote their channel line and its final repaint left 'Saving for
offline…' on the card after the save had finished.
This commit is contained in:
Jonathan Sykes
2026-10-03 00:59:18 +08:00
parent 16e2b24c31
commit cbffa1fd8b

View File

@@ -305,7 +305,9 @@ const SaveQueue = (() => {
return '⏳ Saving for offline…';
}
function paint(id) {
const row = document.querySelector(`.card.downloading[data-id="${CSS.escape(id)}"]`);
// Only the Downloads view's own rows: search/playlist cards also carry
// .downloading while a save runs, and their channel line must not be touched.
const row = document.querySelector(`.card.dl-row[data-id="${CSS.escape(id)}"]`);
if (!row) return;
const p = get(id);
const ch = row.querySelector('.card-channel');
@@ -8468,7 +8470,7 @@ function renderDownloads() {
const rowFor = (v, isPaused) => {
const row = document.createElement('div');
row.className = 'card downloading' + (isPaused ? ' dl-paused' : '');
row.className = 'card downloading dl-row' + (isPaused ? ' dl-paused' : '');
row.dataset.id = v.id;
row.innerHTML = `
<div class="thumb">