diff --git a/web-src/src/pages/PageSearchLibrary.vue b/web-src/src/pages/PageSearchLibrary.vue index 0b000102..246f3c2b 100644 --- a/web-src/src/pages/PageSearchLibrary.vue +++ b/web-src/src/pages/PageSearchLibrary.vue @@ -49,7 +49,7 @@ - + @@ -57,11 +57,11 @@ - + + - + @@ -86,11 +86,11 @@ - + + - + @@ -115,11 +115,11 @@ - + + - + @@ -144,11 +144,11 @@ - + + - + @@ -173,11 +173,11 @@ - + + - + @@ -202,11 +202,11 @@ - + + - + @@ -232,11 +232,11 @@ - + + @@ -296,56 +296,6 @@ export default { computed: { recent_searches() { return this.$store.state.recent_searches - }, - show_albums() { - return this.$route.query.type && this.$route.query.type.includes('album') - }, - show_all_albums_button() { - return this.albums.total > this.albums.items.length - }, - show_all_artists_button() { - return this.artists.total > this.artists.items.length - }, - show_all_audiobooks_button() { - return this.audiobooks.total > this.audiobooks.items.length - }, - show_all_composers_button() { - return this.composers.total > this.composers.items.length - }, - show_all_playlists_button() { - return this.playlists.total > this.playlists.items.length - }, - show_all_podcasts_button() { - return this.podcasts.total > this.podcasts.items.length - }, - show_all_tracks_button() { - return this.tracks.total > this.tracks.items.length - }, - show_artists() { - return this.$route.query.type && this.$route.query.type.includes('artist') - }, - show_audiobooks() { - return ( - this.$route.query.type && this.$route.query.type.includes('audiobook') - ) - }, - show_composers() { - return ( - this.$route.query.type && this.$route.query.type.includes('composer') - ) - }, - show_playlists() { - return ( - this.$route.query.type && this.$route.query.type.includes('playlist') - ) - }, - show_podcasts() { - return ( - this.$route.query.type && this.$route.query.type.includes('podcast') - ) - }, - show_tracks() { - return this.$route.query.type && this.$route.query.type.includes('track') } }, @@ -379,7 +329,8 @@ export default { query.type.indexOf('track') < 0 && query.type.indexOf('artist') < 0 && query.type.indexOf('album') < 0 && - query.type.indexOf('playlist') < 0 + query.type.indexOf('playlist') < 0 && + query.type.indexOf('composer') < 0 ) { return } @@ -478,72 +429,20 @@ export default { this.$refs.search_field.blur() }, - open_search_tracks() { - this.$router.push({ - name: 'search-library', - query: { - query: this.$route.query.query, - type: 'track' - } - }) + show(type) { + return this.$route.query.type?.includes(type) ?? false }, - open_search_artists() { - this.$router.push({ - name: 'search-library', - query: { - query: this.$route.query.query, - type: 'artist' - } - }) + show_all_button(items) { + return items.total > items.items.length }, - open_search_albums() { + open_search(type) { this.$router.push({ name: 'search-library', query: { query: this.$route.query.query, - type: 'album' - } - }) - }, - - open_search_composers() { - this.$router.push({ - name: 'search-library', - query: { - query: this.$route.query.query, - type: 'tracks' - } - }) - }, - - open_search_playlists() { - this.$router.push({ - name: 'search-library', - query: { - query: this.$route.query.query, - type: 'playlist' - } - }) - }, - - open_search_audiobooks() { - this.$router.push({ - name: 'search-library', - query: { - query: this.$route.query.query, - type: 'audiobook' - } - }) - }, - - open_search_podcasts() { - this.$router.push({ - name: 'search-library', - query: { - query: this.$route.query.query, - type: 'podcast' + type: type } }) },
+ - + @@ -86,11 +86,11 @@
+ - + @@ -115,11 +115,11 @@
+ - + @@ -144,11 +144,11 @@
+ - + @@ -173,11 +173,11 @@
+ - + @@ -202,11 +202,11 @@
+ - + @@ -232,11 +232,11 @@
+ @@ -296,56 +296,6 @@ export default { computed: { recent_searches() { return this.$store.state.recent_searches - }, - show_albums() { - return this.$route.query.type && this.$route.query.type.includes('album') - }, - show_all_albums_button() { - return this.albums.total > this.albums.items.length - }, - show_all_artists_button() { - return this.artists.total > this.artists.items.length - }, - show_all_audiobooks_button() { - return this.audiobooks.total > this.audiobooks.items.length - }, - show_all_composers_button() { - return this.composers.total > this.composers.items.length - }, - show_all_playlists_button() { - return this.playlists.total > this.playlists.items.length - }, - show_all_podcasts_button() { - return this.podcasts.total > this.podcasts.items.length - }, - show_all_tracks_button() { - return this.tracks.total > this.tracks.items.length - }, - show_artists() { - return this.$route.query.type && this.$route.query.type.includes('artist') - }, - show_audiobooks() { - return ( - this.$route.query.type && this.$route.query.type.includes('audiobook') - ) - }, - show_composers() { - return ( - this.$route.query.type && this.$route.query.type.includes('composer') - ) - }, - show_playlists() { - return ( - this.$route.query.type && this.$route.query.type.includes('playlist') - ) - }, - show_podcasts() { - return ( - this.$route.query.type && this.$route.query.type.includes('podcast') - ) - }, - show_tracks() { - return this.$route.query.type && this.$route.query.type.includes('track') } }, @@ -379,7 +329,8 @@ export default { query.type.indexOf('track') < 0 && query.type.indexOf('artist') < 0 && query.type.indexOf('album') < 0 && - query.type.indexOf('playlist') < 0 + query.type.indexOf('playlist') < 0 && + query.type.indexOf('composer') < 0 ) { return } @@ -478,72 +429,20 @@ export default { this.$refs.search_field.blur() }, - open_search_tracks() { - this.$router.push({ - name: 'search-library', - query: { - query: this.$route.query.query, - type: 'track' - } - }) + show(type) { + return this.$route.query.type?.includes(type) ?? false }, - open_search_artists() { - this.$router.push({ - name: 'search-library', - query: { - query: this.$route.query.query, - type: 'artist' - } - }) + show_all_button(items) { + return items.total > items.items.length }, - open_search_albums() { + open_search(type) { this.$router.push({ name: 'search-library', query: { query: this.$route.query.query, - type: 'album' - } - }) - }, - - open_search_composers() { - this.$router.push({ - name: 'search-library', - query: { - query: this.$route.query.query, - type: 'tracks' - } - }) - }, - - open_search_playlists() { - this.$router.push({ - name: 'search-library', - query: { - query: this.$route.query.query, - type: 'playlist' - } - }) - }, - - open_search_audiobooks() { - this.$router.push({ - name: 'search-library', - query: { - query: this.$route.query.query, - type: 'audiobook' - } - }) - }, - - open_search_podcasts() { - this.$router.push({ - name: 'search-library', - query: { - query: this.$route.query.query, - type: 'podcast' + type: type } }) },