feat: allow non-admin users to blocklist & search under specific conditions
All checks were successful
Build and Push Docker Image / build (push) Successful in 37s
CI / Security audit (push) Successful in 1m30s
CI / Tests & coverage (push) Successful in 1m47s

- Added addedOn timestamp to qBittorrent torrent mapping
- Added canBlocklist helper function: true for admins, true for non-admins when (importIssues OR (torrent >1h old AND availability<100%))
- Added canBlocklist field to all download objects in /user-downloads and SSE /stream routes (8 blocks total)
- Frontend button now shows when (isAdmin OR download.canBlocklist) && download.arrQueueId
This commit is contained in:
2026-05-17 23:57:06 +01:00
parent 0341540751
commit 2747ca7754
3 changed files with 27 additions and 1 deletions

View File

@@ -556,7 +556,7 @@ function createDownloadCard(download) {
header.appendChild(issueBadge);
}
if (isAdmin && download.arrQueueId) {
if ((isAdmin || download.canBlocklist) && download.arrQueueId) {
const blBtn = document.createElement('button');
blBtn.className = 'blocklist-search-btn';
blBtn.textContent = '⛔ Blocklist & Search';