feat: show blocklist & search button on all admin downloads (not just import-pending)
Build and Push Docker Image / build (push) Successful in 35s
CI / Security audit (push) Successful in 1m23s
CI / Tests & coverage (push) Successful in 1m43s

- Remove importIssues condition from arr action fields threading in /user-downloads route (all 4 blocks: SAB+Sonarr, SAB+Radarr, qBit+Sonarr, qBit+Radarr)
- Remove importIssues condition from arr action fields threading in SSE /stream route (all 4 blocks)
- Move blocklist button rendering outside importIssues condition in frontend — now shows for all admin downloads with arrQueueId
This commit is contained in:
2026-05-17 23:43:37 +01:00
parent aef21d1b50
commit 0341540751
2 changed files with 36 additions and 44 deletions
+1 -1
View File
@@ -554,6 +554,7 @@ function createDownloadCard(download) {
issueBadge.textContent = 'Import Pending'; issueBadge.textContent = 'Import Pending';
issueBadge.setAttribute('data-tooltip', download.importIssues.join('\n')); issueBadge.setAttribute('data-tooltip', download.importIssues.join('\n'));
header.appendChild(issueBadge); header.appendChild(issueBadge);
}
if (isAdmin && download.arrQueueId) { if (isAdmin && download.arrQueueId) {
const blBtn = document.createElement('button'); const blBtn = document.createElement('button');
@@ -563,7 +564,6 @@ function createDownloadCard(download) {
blBtn.addEventListener('click', () => handleBlocklistSearch(blBtn, download)); blBtn.addEventListener('click', () => handleBlocklistSearch(blBtn, download));
header.appendChild(blBtn); header.appendChild(blBtn);
} }
}
const title = document.createElement('h3'); const title = document.createElement('h3');
title.className = 'download-title'; title.className = 'download-title';
+4 -12
View File
@@ -321,7 +321,6 @@ router.get('/user-downloads', requireAuth, async (req, res) => {
dlObj.downloadPath = slot.storage || null; dlObj.downloadPath = slot.storage || null;
dlObj.targetPath = series.path || null; dlObj.targetPath = series.path || null;
dlObj.arrLink = getSonarrLink(series); dlObj.arrLink = getSonarrLink(series);
if (issues) {
dlObj.arrQueueId = sonarrMatch.id; dlObj.arrQueueId = sonarrMatch.id;
dlObj.arrType = 'sonarr'; dlObj.arrType = 'sonarr';
dlObj.arrInstanceUrl = sonarrMatch._instanceUrl || null; dlObj.arrInstanceUrl = sonarrMatch._instanceUrl || null;
@@ -329,7 +328,6 @@ router.get('/user-downloads', requireAuth, async (req, res) => {
dlObj.arrContentId = sonarrMatch.episodeId || null; dlObj.arrContentId = sonarrMatch.episodeId || null;
dlObj.arrContentType = 'episode'; dlObj.arrContentType = 'episode';
} }
}
userDownloads.push(dlObj); userDownloads.push(dlObj);
} }
} }
@@ -371,7 +369,6 @@ router.get('/user-downloads', requireAuth, async (req, res) => {
dlObj.downloadPath = slot.storage || null; dlObj.downloadPath = slot.storage || null;
dlObj.targetPath = movie.path || null; dlObj.targetPath = movie.path || null;
dlObj.arrLink = getRadarrLink(movie); dlObj.arrLink = getRadarrLink(movie);
if (issues) {
dlObj.arrQueueId = radarrMatch.id; dlObj.arrQueueId = radarrMatch.id;
dlObj.arrType = 'radarr'; dlObj.arrType = 'radarr';
dlObj.arrInstanceUrl = radarrMatch._instanceUrl || null; dlObj.arrInstanceUrl = radarrMatch._instanceUrl || null;
@@ -379,7 +376,6 @@ router.get('/user-downloads', requireAuth, async (req, res) => {
dlObj.arrContentId = radarrMatch.movieId || null; dlObj.arrContentId = radarrMatch.movieId || null;
dlObj.arrContentType = 'movie'; dlObj.arrContentType = 'movie';
} }
}
userDownloads.push(dlObj); userDownloads.push(dlObj);
} }
} }
@@ -536,7 +532,6 @@ router.get('/user-downloads', requireAuth, async (req, res) => {
download.downloadPath = download.savePath || null; download.downloadPath = download.savePath || null;
download.targetPath = series.path || null; download.targetPath = series.path || null;
download.arrLink = getSonarrLink(series); download.arrLink = getSonarrLink(series);
if (sonarrIssues) {
download.arrQueueId = sonarrMatch.id; download.arrQueueId = sonarrMatch.id;
download.arrType = 'sonarr'; download.arrType = 'sonarr';
download.arrInstanceUrl = sonarrMatch._instanceUrl || null; download.arrInstanceUrl = sonarrMatch._instanceUrl || null;
@@ -544,7 +539,6 @@ router.get('/user-downloads', requireAuth, async (req, res) => {
download.arrContentId = sonarrMatch.episodeId || null; download.arrContentId = sonarrMatch.episodeId || null;
download.arrContentType = 'episode'; download.arrContentType = 'episode';
} }
}
userDownloads.push(download); userDownloads.push(download);
continue; // Skip to next torrent continue; // Skip to next torrent
} }
@@ -579,7 +573,6 @@ router.get('/user-downloads', requireAuth, async (req, res) => {
download.downloadPath = download.savePath || null; download.downloadPath = download.savePath || null;
download.targetPath = movie.path || null; download.targetPath = movie.path || null;
download.arrLink = getRadarrLink(movie); download.arrLink = getRadarrLink(movie);
if (radarrIssues) {
download.arrQueueId = radarrMatch.id; download.arrQueueId = radarrMatch.id;
download.arrType = 'radarr'; download.arrType = 'radarr';
download.arrInstanceUrl = radarrMatch._instanceUrl || null; download.arrInstanceUrl = radarrMatch._instanceUrl || null;
@@ -587,7 +580,6 @@ router.get('/user-downloads', requireAuth, async (req, res) => {
download.arrContentId = radarrMatch.movieId || null; download.arrContentId = radarrMatch.movieId || null;
download.arrContentType = 'movie'; download.arrContentType = 'movie';
} }
}
userDownloads.push(download); userDownloads.push(download);
continue; // Skip to next torrent continue; // Skip to next torrent
} }
@@ -925,7 +917,7 @@ router.get('/stream', requireAuth, async (req, res) => {
const dlObj = { type: 'series', title: nzbName, coverArt: getCoverArt(series), status: slotState.status, progress: slot.percentage, mb: slot.mb, mbmissing: slot.mbmissing, size: slot.size, speed: slotState.speed, eta: slot.timeleft, seriesName: series.title, episodes: gatherEpisodes(nzbNameLower, sonarrQueue.data.records), allTags, matchedUserTag: matchedUserTag || null, tagBadges: showAll ? buildTagBadges(allTags, embyUserMap) : undefined }; const dlObj = { type: 'series', title: nzbName, coverArt: getCoverArt(series), status: slotState.status, progress: slot.percentage, mb: slot.mb, mbmissing: slot.mbmissing, size: slot.size, speed: slotState.speed, eta: slot.timeleft, seriesName: series.title, episodes: gatherEpisodes(nzbNameLower, sonarrQueue.data.records), allTags, matchedUserTag: matchedUserTag || null, tagBadges: showAll ? buildTagBadges(allTags, embyUserMap) : undefined };
const issues = getImportIssues(sonarrMatch); const issues = getImportIssues(sonarrMatch);
if (issues) dlObj.importIssues = issues; if (issues) dlObj.importIssues = issues;
if (isAdmin) { dlObj.downloadPath = slot.storage || null; dlObj.targetPath = series.path || null; dlObj.arrLink = getSonarrLink(series); if (issues) { dlObj.arrQueueId = sonarrMatch.id; dlObj.arrType = 'sonarr'; dlObj.arrInstanceUrl = sonarrMatch._instanceUrl || null; dlObj.arrInstanceKey = sonarrMatch._instanceKey || null; dlObj.arrContentId = sonarrMatch.episodeId || null; dlObj.arrContentType = 'episode'; } } if (isAdmin) { dlObj.downloadPath = slot.storage || null; dlObj.targetPath = series.path || null; dlObj.arrLink = getSonarrLink(series); dlObj.arrQueueId = sonarrMatch.id; dlObj.arrType = 'sonarr'; dlObj.arrInstanceUrl = sonarrMatch._instanceUrl || null; dlObj.arrInstanceKey = sonarrMatch._instanceKey || null; dlObj.arrContentId = sonarrMatch.episodeId || null; dlObj.arrContentType = 'episode'; }
userDownloads.push(dlObj); userDownloads.push(dlObj);
} }
} }
@@ -944,7 +936,7 @@ router.get('/stream', requireAuth, async (req, res) => {
const dlObj = { type: 'movie', title: nzbName, coverArt: getCoverArt(movie), status: slotState.status, progress: slot.percentage, mb: slot.mb, mbmissing: slot.mbmissing, size: slot.size, speed: slotState.speed, eta: slot.timeleft, movieName: movie.title, movieInfo: radarrMatch, allTags, matchedUserTag: matchedUserTag || null, tagBadges: showAll ? buildTagBadges(allTags, embyUserMap) : undefined }; const dlObj = { type: 'movie', title: nzbName, coverArt: getCoverArt(movie), status: slotState.status, progress: slot.percentage, mb: slot.mb, mbmissing: slot.mbmissing, size: slot.size, speed: slotState.speed, eta: slot.timeleft, movieName: movie.title, movieInfo: radarrMatch, allTags, matchedUserTag: matchedUserTag || null, tagBadges: showAll ? buildTagBadges(allTags, embyUserMap) : undefined };
const issues = getImportIssues(radarrMatch); const issues = getImportIssues(radarrMatch);
if (issues) dlObj.importIssues = issues; if (issues) dlObj.importIssues = issues;
if (isAdmin) { dlObj.downloadPath = slot.storage || null; dlObj.targetPath = movie.path || null; dlObj.arrLink = getRadarrLink(movie); if (issues) { dlObj.arrQueueId = radarrMatch.id; dlObj.arrType = 'radarr'; dlObj.arrInstanceUrl = radarrMatch._instanceUrl || null; dlObj.arrInstanceKey = radarrMatch._instanceKey || null; dlObj.arrContentId = radarrMatch.movieId || null; dlObj.arrContentType = 'movie'; } } if (isAdmin) { dlObj.downloadPath = slot.storage || null; dlObj.targetPath = movie.path || null; dlObj.arrLink = getRadarrLink(movie); dlObj.arrQueueId = radarrMatch.id; dlObj.arrType = 'radarr'; dlObj.arrInstanceUrl = radarrMatch._instanceUrl || null; dlObj.arrInstanceKey = radarrMatch._instanceKey || null; dlObj.arrContentId = radarrMatch.movieId || null; dlObj.arrContentType = 'movie'; }
userDownloads.push(dlObj); userDownloads.push(dlObj);
} }
} }
@@ -1011,7 +1003,7 @@ router.get('/stream', requireAuth, async (req, res) => {
const download = mapTorrentToDownload(torrent); const download = mapTorrentToDownload(torrent);
Object.assign(download, { type: 'series', coverArt: getCoverArt(series), seriesName: series.title, episodes: gatherEpisodes(torrentNameLower, sonarrQueue.data.records), allTags, matchedUserTag: matchedUserTag || null, tagBadges: showAll ? buildTagBadges(allTags, embyUserMap) : undefined }); Object.assign(download, { type: 'series', coverArt: getCoverArt(series), seriesName: series.title, episodes: gatherEpisodes(torrentNameLower, sonarrQueue.data.records), allTags, matchedUserTag: matchedUserTag || null, tagBadges: showAll ? buildTagBadges(allTags, embyUserMap) : undefined });
const issues = getImportIssues(sonarrMatch); if (issues) download.importIssues = issues; const issues = getImportIssues(sonarrMatch); if (issues) download.importIssues = issues;
if (isAdmin) { download.downloadPath = download.savePath || null; download.targetPath = series.path || null; download.arrLink = getSonarrLink(series); if (issues) { download.arrQueueId = sonarrMatch.id; download.arrType = 'sonarr'; download.arrInstanceUrl = sonarrMatch._instanceUrl || null; download.arrInstanceKey = sonarrMatch._instanceKey || null; download.arrContentId = sonarrMatch.episodeId || null; download.arrContentType = 'episode'; } } if (isAdmin) { download.downloadPath = download.savePath || null; download.targetPath = series.path || null; download.arrLink = getSonarrLink(series); download.arrQueueId = sonarrMatch.id; download.arrType = 'sonarr'; download.arrInstanceUrl = sonarrMatch._instanceUrl || null; download.arrInstanceKey = sonarrMatch._instanceKey || null; download.arrContentId = sonarrMatch.episodeId || null; download.arrContentType = 'episode'; }
userDownloads.push(download); continue; userDownloads.push(download); continue;
} }
} }
@@ -1027,7 +1019,7 @@ router.get('/stream', requireAuth, async (req, res) => {
const download = mapTorrentToDownload(torrent); const download = mapTorrentToDownload(torrent);
Object.assign(download, { type: 'movie', coverArt: getCoverArt(movie), movieName: movie.title, movieInfo: radarrMatch, allTags, matchedUserTag: matchedUserTag || null, tagBadges: showAll ? buildTagBadges(allTags, embyUserMap) : undefined }); Object.assign(download, { type: 'movie', coverArt: getCoverArt(movie), movieName: movie.title, movieInfo: radarrMatch, allTags, matchedUserTag: matchedUserTag || null, tagBadges: showAll ? buildTagBadges(allTags, embyUserMap) : undefined });
const issues = getImportIssues(radarrMatch); if (issues) download.importIssues = issues; const issues = getImportIssues(radarrMatch); if (issues) download.importIssues = issues;
if (isAdmin) { download.downloadPath = download.savePath || null; download.targetPath = movie.path || null; download.arrLink = getRadarrLink(movie); if (issues) { download.arrQueueId = radarrMatch.id; download.arrType = 'radarr'; download.arrInstanceUrl = radarrMatch._instanceUrl || null; download.arrInstanceKey = radarrMatch._instanceKey || null; download.arrContentId = radarrMatch.movieId || null; download.arrContentType = 'movie'; } } if (isAdmin) { download.downloadPath = download.savePath || null; download.targetPath = movie.path || null; download.arrLink = getRadarrLink(movie); download.arrQueueId = radarrMatch.id; download.arrType = 'radarr'; download.arrInstanceUrl = radarrMatch._instanceUrl || null; download.arrInstanceKey = radarrMatch._instanceKey || null; download.arrContentId = radarrMatch.movieId || null; download.arrContentType = 'movie'; }
userDownloads.push(download); continue; userDownloads.push(download); continue;
} }
} }