perf: Sort tags alphabetically (#683) @Larsluph

This commit is contained in:
Rémi Marseault 2023-02-28 14:23:52 +01:00 committed by GitHub
parent 2784ab97cf
commit 3d1415deab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View file

@ -1,5 +1,5 @@
<template>
<v-dialog v-model="dialog" scrollable max-width="750px" :content-class="isPhone ? 'rounded-0' : 'rounded-form'" :fullscreen="isPhone">
<v-dialog v-model="dialog" scrollable max-width="750px" :content-class="phoneLayout ? 'rounded-0' : 'rounded-form'" :fullscreen="phoneLayout">
<v-card>
<v-card-title class="pa-0">
<v-toolbar-title class="ma-4 primarytext--text">
@ -52,9 +52,6 @@ export default {
...mapGetters(['getTorrent']),
torrent() {
return this.getTorrent(this.hash)
},
isPhone() {
return this.$vuetify.breakpoint.xsOnly
}
},
mounted() {
@ -75,7 +72,7 @@ export default {
isUrl() {
this.enableUrlDecode = false
if (this.name.indexOf(' ') === -1) {
const exp = /\+|%/
const exp = /[+%]/
if (exp.test(this.name)) this.enableUrlDecode = true
}
},

View file

@ -141,7 +141,7 @@ export class QBitApi {
}
async getAvailableTags(): Promise<string[]> {
return this.axios.get('/torrents/tags').then(res => res.data)
return this.axios.get('/torrents/tags').then(res => res.data.sort((a: string, b: string) => a.localeCompare(b.toLowerCase(), undefined, {sensitivity: 'base'})))
}
async getTorrentProperties(hash: string): Promise<TorrentProperties> {