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

@@ -204,6 +204,7 @@ function mapTorrentToDownload(torrent) {
category: torrent.category,
tags: torrent.tags,
savePath: torrent.content_path || torrent.save_path || null,
addedOn: torrent.added_on || null,
qbittorrent: true
};
}