Skip to content

Commit

Permalink
Feat : Url decode formula in rename modal (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
m4ximuel committed Apr 25, 2021
1 parent a9653d9 commit 0c471a4
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/components/Modals/RenameModal.vue
Expand Up @@ -30,6 +30,14 @@
</v-card-text>
<v-divider />
<v-card-actions class="justify-end">
<v-btn
v-if="enableUrlDecode"
class="info white--text elevation-0 px-4"
@click="urlDecode"
>
URL DECODE
</v-btn>
<v-spacer />
<v-btn
class="accent white--text elevation-0 px-4"
@click="rename"
Expand Down Expand Up @@ -76,8 +84,21 @@ export default {
},
created() {
this.name = this.torrent.name
this.isUrl()
},
methods: {
urlDecode() {
this.name = decodeURIComponent(this.name)
this.isUrl()
},
isUrl() {
this.enableUrlDecode = false
if (this.name.indexOf(' ') == -1) {
const exp = /\+|%/
if (exp.test(this.name))
this.enableUrlDecode = true
}
},
rename() {
qbit.setTorrentName(this.hash, this.name)
this.close()
Expand Down

0 comments on commit 0c471a4

Please sign in to comment.