From d8f0d2e1a72c14c271c8e0550bea8f930295ddcf Mon Sep 17 00:00:00 2001 From: Liang Yi Date: Sun, 19 Apr 2020 22:43:03 +0800 Subject: [PATCH] Support setting file priority in content view (#26) --- src/Api.ts | 12 ++++ src/components/dialogs/TorrentContent.vue | 74 ++++++++++++++++++++--- 2 files changed, 77 insertions(+), 9 deletions(-) diff --git a/src/Api.ts b/src/Api.ts index 5abec7e..e02a33a 100644 --- a/src/Api.ts +++ b/src/Api.ts @@ -83,6 +83,18 @@ class Api { return this.axios.post('/app/setPreferences', data); } + public setTorrentFilePriority(hash: string, idList: Array, priority: number) { + const idListStr = idList.join('|'); + const params: any = { + hash, + id: idListStr, + priority, + } + + const data = new URLSearchParams(params); + return this.axios.post(`/torrents/filePrio`, data).then(Api.handleResponse); + } + public getLogs(lastId?: number) { const params = { last_known_id: lastId, diff --git a/src/components/dialogs/TorrentContent.vue b/src/components/dialogs/TorrentContent.vue index fd2e962..36408cf 100644 --- a/src/components/dialogs/TorrentContent.vue +++ b/src/components/dialogs/TorrentContent.vue @@ -3,6 +3,9 @@