fix: Invalid deconstruct on qbit service (#623)

This commit is contained in:
Rémi Marseault 2023-01-27 06:04:05 +01:00 committed by GitHub
parent e09e8a0300
commit 5a2ed4ea99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 10 deletions

View file

@ -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/', '')

View file

@ -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

View file

@ -145,7 +145,7 @@
</td>
<td>
<span v-for="trackersPart in splitString(torrent.tracker)" :key="trackersPart">
<a v-if="stringContainsUrl(trackersPart)" _target="blank" :href="trackersPart">{{ trackersPart }}</a>
<a v-if="stringContainsUrl(trackersPart)" target="_blank" :href="trackersPart">{{ trackersPart }}</a>
<span v-else>{{ trackersPart }}</span>
</span>
</td>
@ -156,7 +156,7 @@
</td>
<td>
<span v-for="createdByPart in splitString(createdBy)" :key="createdByPart">
<a v-if="stringContainsUrl(createdByPart)" _target="blank" :href="createdByPart">{{ createdByPart }}</a>
<a v-if="stringContainsUrl(createdByPart)" target="_blank" :href="createdByPart">{{ createdByPart }}</a>
<span v-else>{{ createdByPart }}</span>
</span>
</td>
@ -167,7 +167,7 @@
</td>
<td>
<span v-for="commentPart in splitString(comment)" :key="commentPart">
<a v-if="stringContainsUrl(commentPart)" _target="blank" :href="commentPart">{{ commentPart }}</a>
<a v-if="stringContainsUrl(commentPart)" target="_blank" :href="commentPart">{{ commentPart }}</a>
<span v-else>{{ commentPart }}</span>
</span>
</td>
@ -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) {

View file

@ -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