fix: bugs introduced with search engine (#853)

This commit is contained in:
Rémi Marseault 2023-06-05 17:28:16 +02:00 committed by GitHub
parent 154ba1973d
commit ff301f249c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View file

@ -175,7 +175,7 @@ export default {
item.newName = item.name
this.toggleEditing(item)
},
async renameFile(item) {
renameFile(item) {
const lastPathSep = item.fullName.lastIndexOf('/')
const args = [this.hash]
@ -185,12 +185,12 @@ export default {
args.push(`${prefix}/${item.name}`, `${prefix}/${item.newName}`)
}
await qbit.renameFile(...args).catch(() => Vue.$toast.error(this.$t('toast.renameFileFailed')))
qbit.renameFile(...args).catch(() => Vue.$toast.error(this.$t('toast.renameFileFailed')))
item.name = item.newName
this.toggleEditing(item)
},
async renameFolder(item) {
renameFolder(item) {
const lastPathSep = item.fullName.lastIndexOf('/')
const args = [this.hash]
@ -200,13 +200,13 @@ export default {
args.push(`${prefix}/${item.name}`, `${prefix}/${item.newName}`)
}
await qbit.renameFolder(...args).catch(() => Vue.$toast.error(this.$t('toast.renameFolderFailed')))
qbit.renameFolder(...args).catch(() => Vue.$toast.error(this.$t('toast.renameFolderFailed')))
item.name = item.newName
this.toggleEditing(item)
},
async setFilePrio(fileId, priority) {
await qbit.setTorrentFilePriority(this.hash, [fileId], priority).then(() => this.initFiles())
setFilePrio(fileId, priority) {
qbit.setTorrentFilePriority(this.hash, [fileId], priority).then(() => this.initFiles())
}
}
}

View file

@ -80,6 +80,7 @@ export default {
async addTag(tag) {
if (this.activeTags.includes(this.availableTags.indexOf(tag))) {
await this.deleteTag(tag)
return
}
await qbit.addTorrentTag([this.hash], [tag])
@ -90,6 +91,7 @@ export default {
async setCategory(cat) {
if (this.torrent.category === cat.name) {
await this.deleteCategory()
return
}
await qbit.setCategory([this.hash], cat.name)