From 5a2ed4ea99a81f5566e3276acb8faae42adcc035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Marseault?= <22910497+Larsluph@users.noreply.github.com> Date: Fri, 27 Jan 2023 06:04:05 +0100 Subject: [PATCH] fix: Invalid deconstruct on qbit service (#623) --- src/components/TorrentDetail/Tabs/Content.vue | 2 +- src/components/TorrentDetail/Tabs/DetailPeers.vue | 2 +- src/components/TorrentDetail/Tabs/Info.vue | 10 +++++----- src/components/TorrentDetail/Tabs/Trackers.vue | 5 ++--- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/components/TorrentDetail/Tabs/Content.vue b/src/components/TorrentDetail/Tabs/Content.vue index 814da87f..19092fa4 100644 --- a/src/components/TorrentDetail/Tabs/Content.vue +++ b/src/components/TorrentDetail/Tabs/Content.vue @@ -137,7 +137,7 @@ export default { }) }, async getTorrentFiles() { - const { data } = await qbit.getTorrentFiles(this.hash) + const data = await qbit.getTorrentFiles(this.hash) data.forEach((d, i) => { d.id = i d.name = d.name.replace('.unwanted/', '') diff --git a/src/components/TorrentDetail/Tabs/DetailPeers.vue b/src/components/TorrentDetail/Tabs/DetailPeers.vue index 4f2309a3..4c67bc9c 100644 --- a/src/components/TorrentDetail/Tabs/DetailPeers.vue +++ b/src/components/TorrentDetail/Tabs/DetailPeers.vue @@ -129,7 +129,7 @@ export default { return isWindows() }, async getTorrentPeers() { - const { data } = await qbit.getTorrentPeers(this.hash, this.rid + 1 || undefined) + const data = await qbit.getTorrentPeers(this.hash, this.rid + 1 || undefined) this.rid = data.rid diff --git a/src/components/TorrentDetail/Tabs/Info.vue b/src/components/TorrentDetail/Tabs/Info.vue index 92f59880..86bd14f4 100644 --- a/src/components/TorrentDetail/Tabs/Info.vue +++ b/src/components/TorrentDetail/Tabs/Info.vue @@ -145,7 +145,7 @@ - {{ trackersPart }} + {{ trackersPart }} {{ trackersPart }} @@ -156,7 +156,7 @@ - {{ createdByPart }} + {{ createdByPart }} {{ createdByPart }} @@ -167,7 +167,7 @@ - {{ commentPart }} + {{ commentPart }} {{ commentPart }} @@ -272,8 +272,8 @@ export default { async renderTorrentPieceStates() { const canvas = document.querySelector('#pieceStates canvas') - const { data: files } = await qbit.getTorrentFiles(this.hash) - const { data: pieces } = await qbit.getTorrentPieceStates(this.hash) + const files = await qbit.getTorrentFiles(this.hash) + const pieces = await qbit.getTorrentPieceStates(this.hash) // Source: https://github.com/qbittorrent/qBittorrent/blob/6229b817300344759139d2fedbd59651065a561d/src/webui/www/private/scripts/prop-general.js#L230 if (pieces) { diff --git a/src/components/TorrentDetail/Tabs/Trackers.vue b/src/components/TorrentDetail/Tabs/Trackers.vue index 51cec608..3fab7fa0 100644 --- a/src/components/TorrentDetail/Tabs/Trackers.vue +++ b/src/components/TorrentDetail/Tabs/Trackers.vue @@ -104,13 +104,12 @@ export default { }, methods: { async getTorrentTrackers() { - const { data } = await qbit.getTorrentTrackers(this.hash) - this.tempTrackers = data + this.tempTrackers = await qbit.getTorrentTrackers(this.hash) }, async addTrackers() { if (!this.newTrackers.length) return (this.trackerDialog = false) - qbit.addTorrentTrackers(this.hash, this.newTrackers) + await qbit.addTorrentTrackers(this.hash, this.newTrackers) this.newTrackers = '' await this.getTorrentTrackers() this.trackerDialog = false