fix(downloads): support Transmission and aria2 end to end

Fixes #65
This commit is contained in:
ShukeBta
2026-08-10 21:04:04 +08:00
parent c0d743d89d
commit 42ef19b7e5
43 changed files with 2350 additions and 480 deletions
+2 -2
View File
@@ -26,9 +26,9 @@ export const downloadsAPI = {
.post<DownloadTask>('/downloads', { url, save_path: savePath, ...meta })
.then((r) => r.data),
remove: (hash: string, deleteFiles = false) =>
remove: (hash: string, clientID: string, deleteFiles = false) =>
api
.delete(`/downloads/${hash}?delete_files=${deleteFiles ? 'true' : 'false'}`)
.delete(`/downloads/${hash}`, { params: { client_id: clientID, delete_files: deleteFiles } })
.then((r) => r.data),
reload: () => api.post('/downloads/reload').then((r) => r.data),
+2 -2
View File
@@ -102,12 +102,12 @@ export function DownloadsPage() {
<div className="grid gap-5 lg:grid-cols-2 2xl:grid-cols-3">
{torrents.map((torrent) => (
<DownloadTaskCard
key={torrent.hash}
key={`${torrent.client_id}:${torrent.hash}`}
item={toLiveCard(torrent)}
removable={role === 'admin'}
onRemove={async () => {
if (!(await confirmAction({ title: '删除下载任务', message: `删除「${torrent.title || torrent.name}」?`, confirmText: '删除' }))) return
await downloadsAPI.remove(torrent.hash, false)
await downloadsAPI.remove(torrent.hash, torrent.client_id, false)
toast.success('已删除任务')
await refresh()
}}
+4
View File
@@ -1,6 +1,8 @@
export interface DownloadTask {
id: string
source: string
download_client_id?: string
external_id?: string
title: string
poster_url?: string
backdrop_url?: string
@@ -21,6 +23,8 @@ export interface DownloadTask {
export interface QBitTorrent {
hash: string
client_id: string
source: 'qbittorrent' | 'transmission' | 'aria2'
name: string
title: string
poster_url?: string