mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-05 02:38:09 -05:00
[web] Fix composers not being displayed in the library search
This commit is contained in:
parent
ed564b1861
commit
fcdcb9162d
@ -49,7 +49,7 @@
|
|||||||
</section>
|
</section>
|
||||||
<tabs-search :query="search_query" />
|
<tabs-search :query="search_query" />
|
||||||
<!-- Tracks -->
|
<!-- Tracks -->
|
||||||
<content-with-heading v-if="show_tracks && tracks.total" class="pt-0">
|
<content-with-heading v-if="show('track') && tracks.total" class="pt-0">
|
||||||
<template #heading-left>
|
<template #heading-left>
|
||||||
<p class="title is-4" v-text="$t('page.search.tracks')" />
|
<p class="title is-4" v-text="$t('page.search.tracks')" />
|
||||||
</template>
|
</template>
|
||||||
@ -57,11 +57,11 @@
|
|||||||
<list-tracks :tracks="tracks" />
|
<list-tracks :tracks="tracks" />
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<nav v-if="show_all_tracks_button" class="level">
|
<nav v-if="show_all_button(tracks)" class="level">
|
||||||
<p class="level-item">
|
<p class="level-item">
|
||||||
<a
|
<a
|
||||||
class="button is-light is-small is-rounded"
|
class="button is-light is-small is-rounded"
|
||||||
@click="open_search_tracks"
|
@click="open_search('track')"
|
||||||
v-text="
|
v-text="
|
||||||
$t('page.search.show-tracks', tracks.total, {
|
$t('page.search.show-tracks', tracks.total, {
|
||||||
count: $filters.number(tracks.total)
|
count: $filters.number(tracks.total)
|
||||||
@ -72,13 +72,13 @@
|
|||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
<content-text v-if="show_tracks && !tracks.total" class="pt-0">
|
<content-text v-if="show('track') && !tracks.total" class="pt-0">
|
||||||
<template #content>
|
<template #content>
|
||||||
<p><i v-text="$t('page.search.no-tracks')" /></p>
|
<p><i v-text="$t('page.search.no-tracks')" /></p>
|
||||||
</template>
|
</template>
|
||||||
</content-text>
|
</content-text>
|
||||||
<!-- Artists -->
|
<!-- Artists -->
|
||||||
<content-with-heading v-if="show_artists && artists.total">
|
<content-with-heading v-if="show('artist') && artists.total">
|
||||||
<template #heading-left>
|
<template #heading-left>
|
||||||
<p class="title is-4" v-text="$t('page.search.artists')" />
|
<p class="title is-4" v-text="$t('page.search.artists')" />
|
||||||
</template>
|
</template>
|
||||||
@ -86,11 +86,11 @@
|
|||||||
<list-artists :artists="artists" :hide_group_title="true" />
|
<list-artists :artists="artists" :hide_group_title="true" />
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<nav v-if="show_all_artists_button" class="level">
|
<nav v-if="show_all_button(artists)" class="level">
|
||||||
<p class="level-item">
|
<p class="level-item">
|
||||||
<a
|
<a
|
||||||
class="button is-light is-small is-rounded"
|
class="button is-light is-small is-rounded"
|
||||||
@click="open_search_artists"
|
@click="open_search('artist')"
|
||||||
v-text="
|
v-text="
|
||||||
$t('page.search.show-artists', artists.total, {
|
$t('page.search.show-artists', artists.total, {
|
||||||
count: $filters.number(artists.total)
|
count: $filters.number(artists.total)
|
||||||
@ -101,13 +101,13 @@
|
|||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
<content-text v-if="show_artists && !artists.total">
|
<content-text v-if="show('artist') && !artists.total">
|
||||||
<template #content>
|
<template #content>
|
||||||
<p><i v-text="$t('page.search.no-artists')" /></p>
|
<p><i v-text="$t('page.search.no-artists')" /></p>
|
||||||
</template>
|
</template>
|
||||||
</content-text>
|
</content-text>
|
||||||
<!-- Albums -->
|
<!-- Albums -->
|
||||||
<content-with-heading v-if="show_albums && albums.total">
|
<content-with-heading v-if="show('album') && albums.total">
|
||||||
<template #heading-left>
|
<template #heading-left>
|
||||||
<p class="title is-4" v-text="$t('page.search.albums')" />
|
<p class="title is-4" v-text="$t('page.search.albums')" />
|
||||||
</template>
|
</template>
|
||||||
@ -115,11 +115,11 @@
|
|||||||
<list-albums :albums="albums" :hide_group_title="true" />
|
<list-albums :albums="albums" :hide_group_title="true" />
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<nav v-if="show_all_albums_button" class="level">
|
<nav v-if="show_all_button(albums)" class="level">
|
||||||
<p class="level-item">
|
<p class="level-item">
|
||||||
<a
|
<a
|
||||||
class="button is-light is-small is-rounded"
|
class="button is-light is-small is-rounded"
|
||||||
@click="open_search_albums"
|
@click="open_search('album')"
|
||||||
v-text="
|
v-text="
|
||||||
$t('page.search.show-albums', albums.total, {
|
$t('page.search.show-albums', albums.total, {
|
||||||
count: $filters.number(albums.total)
|
count: $filters.number(albums.total)
|
||||||
@ -130,13 +130,13 @@
|
|||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
<content-text v-if="show_albums && !albums.total">
|
<content-text v-if="show('album') && !albums.total">
|
||||||
<template #content>
|
<template #content>
|
||||||
<p><i v-text="$t('page.search.no-albums')" /></p>
|
<p><i v-text="$t('page.search.no-albums')" /></p>
|
||||||
</template>
|
</template>
|
||||||
</content-text>
|
</content-text>
|
||||||
<!-- Composers -->
|
<!-- Composers -->
|
||||||
<content-with-heading v-if="show_composers && composers.total">
|
<content-with-heading v-if="show('composer') && composers.total">
|
||||||
<template #heading-left>
|
<template #heading-left>
|
||||||
<p class="title is-4" v-text="$t('page.search.composers')" />
|
<p class="title is-4" v-text="$t('page.search.composers')" />
|
||||||
</template>
|
</template>
|
||||||
@ -144,11 +144,11 @@
|
|||||||
<list-composers :composers="composers" />
|
<list-composers :composers="composers" />
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<nav v-if="show_all_composers_button" class="level">
|
<nav v-if="show_all_button(composers)" class="level">
|
||||||
<p class="level-item">
|
<p class="level-item">
|
||||||
<a
|
<a
|
||||||
class="button is-light is-small is-rounded"
|
class="button is-light is-small is-rounded"
|
||||||
@click="open_search_composers"
|
@click="open_search('composer')"
|
||||||
v-text="
|
v-text="
|
||||||
$t('page.search.show-composers', composers.total, {
|
$t('page.search.show-composers', composers.total, {
|
||||||
count: $filters.number(composers.total)
|
count: $filters.number(composers.total)
|
||||||
@ -159,13 +159,13 @@
|
|||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
<content-text v-if="show_composers && !composers.total">
|
<content-text v-if="show('composer') && !composers.total">
|
||||||
<template #content>
|
<template #content>
|
||||||
<p><i v-text="$t('page.search.no-composers')" /></p>
|
<p><i v-text="$t('page.search.no-composers')" /></p>
|
||||||
</template>
|
</template>
|
||||||
</content-text>
|
</content-text>
|
||||||
<!-- Playlists -->
|
<!-- Playlists -->
|
||||||
<content-with-heading v-if="show_playlists && playlists.total">
|
<content-with-heading v-if="show('playlist') && playlists.total">
|
||||||
<template #heading-left>
|
<template #heading-left>
|
||||||
<p class="title is-4" v-text="$t('page.search.playlists')" />
|
<p class="title is-4" v-text="$t('page.search.playlists')" />
|
||||||
</template>
|
</template>
|
||||||
@ -173,11 +173,11 @@
|
|||||||
<list-playlists :playlists="playlists" />
|
<list-playlists :playlists="playlists" />
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<nav v-if="show_all_playlists_button" class="level">
|
<nav v-if="show_all_button(playlists)" class="level">
|
||||||
<p class="level-item">
|
<p class="level-item">
|
||||||
<a
|
<a
|
||||||
class="button is-light is-small is-rounded"
|
class="button is-light is-small is-rounded"
|
||||||
@click="open_search_playlists"
|
@click="open_search('playlist')"
|
||||||
v-text="
|
v-text="
|
||||||
$t('page.search.show-playlists', playlists.total, {
|
$t('page.search.show-playlists', playlists.total, {
|
||||||
count: $filters.number(playlists.total)
|
count: $filters.number(playlists.total)
|
||||||
@ -188,13 +188,13 @@
|
|||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
<content-text v-if="show_playlists && !playlists.total">
|
<content-text v-if="show('playlist') && !playlists.total">
|
||||||
<template #content>
|
<template #content>
|
||||||
<p><i v-text="$t('page.search.no-playlists')" /></p>
|
<p><i v-text="$t('page.search.no-playlists')" /></p>
|
||||||
</template>
|
</template>
|
||||||
</content-text>
|
</content-text>
|
||||||
<!-- Podcasts -->
|
<!-- Podcasts -->
|
||||||
<content-with-heading v-if="show_podcasts && podcasts.total">
|
<content-with-heading v-if="show('podcast') && podcasts.total">
|
||||||
<template #heading-left>
|
<template #heading-left>
|
||||||
<p class="title is-4" v-text="$t('page.search.podcasts')" />
|
<p class="title is-4" v-text="$t('page.search.podcasts')" />
|
||||||
</template>
|
</template>
|
||||||
@ -202,11 +202,11 @@
|
|||||||
<list-albums :albums="podcasts" />
|
<list-albums :albums="podcasts" />
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<nav v-if="show_all_podcasts_button" class="level">
|
<nav v-if="show_all_button(podcasts)" class="level">
|
||||||
<p class="level-item">
|
<p class="level-item">
|
||||||
<a
|
<a
|
||||||
class="button is-light is-small is-rounded"
|
class="button is-light is-small is-rounded"
|
||||||
@click="open_search_podcasts"
|
@click="open_search('podcast')"
|
||||||
v-text="
|
v-text="
|
||||||
$t('page.search.show-podcasts', podcasts.total, {
|
$t('page.search.show-podcasts', podcasts.total, {
|
||||||
count: $filters.number(podcasts.total)
|
count: $filters.number(podcasts.total)
|
||||||
@ -217,14 +217,14 @@
|
|||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
<content-text v-if="show_podcasts && !podcasts.total">
|
<content-text v-if="show('podcast') && !podcasts.total">
|
||||||
<template #content>
|
<template #content>
|
||||||
<p><i v-text="$t('page.search.no-podcasts')" /></p>
|
<p><i v-text="$t('page.search.no-podcasts')" /></p>
|
||||||
</template>
|
</template>
|
||||||
</content-text>
|
</content-text>
|
||||||
|
|
||||||
<!-- Audiobooks -->
|
<!-- Audiobooks -->
|
||||||
<content-with-heading v-if="show_audiobooks && audiobooks.total">
|
<content-with-heading v-if="show('audiobook') && audiobooks.total">
|
||||||
<template #heading-left>
|
<template #heading-left>
|
||||||
<p class="title is-4" v-text="$t('page.search.audiobooks')" />
|
<p class="title is-4" v-text="$t('page.search.audiobooks')" />
|
||||||
</template>
|
</template>
|
||||||
@ -232,11 +232,11 @@
|
|||||||
<list-albums :albums="audiobooks" />
|
<list-albums :albums="audiobooks" />
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<nav v-if="show_all_audiobooks_button" class="level">
|
<nav v-if="show_all_button(audiobooks)" class="level">
|
||||||
<p class="level-item">
|
<p class="level-item">
|
||||||
<a
|
<a
|
||||||
class="button is-light is-small is-rounded"
|
class="button is-light is-small is-rounded"
|
||||||
@click="open_search_audiobooks"
|
@click="open_search('audiobook')"
|
||||||
v-text="
|
v-text="
|
||||||
$t('page.search.show-audiobooks', audiobooks.total, {
|
$t('page.search.show-audiobooks', audiobooks.total, {
|
||||||
count: $filters.number(audiobooks.total)
|
count: $filters.number(audiobooks.total)
|
||||||
@ -247,7 +247,7 @@
|
|||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
<content-text v-if="show_audiobooks && !audiobooks.total">
|
<content-text v-if="show('audiobook') && !audiobooks.total">
|
||||||
<template #content>
|
<template #content>
|
||||||
<p><i v-text="$t('page.search.no-audiobooks')" /></p>
|
<p><i v-text="$t('page.search.no-audiobooks')" /></p>
|
||||||
</template>
|
</template>
|
||||||
@ -296,56 +296,6 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
recent_searches() {
|
recent_searches() {
|
||||||
return this.$store.state.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('track') < 0 &&
|
||||||
query.type.indexOf('artist') < 0 &&
|
query.type.indexOf('artist') < 0 &&
|
||||||
query.type.indexOf('album') < 0 &&
|
query.type.indexOf('album') < 0 &&
|
||||||
query.type.indexOf('playlist') < 0
|
query.type.indexOf('playlist') < 0 &&
|
||||||
|
query.type.indexOf('composer') < 0
|
||||||
) {
|
) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -478,72 +429,20 @@ export default {
|
|||||||
this.$refs.search_field.blur()
|
this.$refs.search_field.blur()
|
||||||
},
|
},
|
||||||
|
|
||||||
open_search_tracks() {
|
show(type) {
|
||||||
this.$router.push({
|
return this.$route.query.type?.includes(type) ?? false
|
||||||
name: 'search-library',
|
|
||||||
query: {
|
|
||||||
query: this.$route.query.query,
|
|
||||||
type: 'track'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
open_search_artists() {
|
show_all_button(items) {
|
||||||
this.$router.push({
|
return items.total > items.items.length
|
||||||
name: 'search-library',
|
|
||||||
query: {
|
|
||||||
query: this.$route.query.query,
|
|
||||||
type: 'artist'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
open_search_albums() {
|
open_search(type) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'search-library',
|
name: 'search-library',
|
||||||
query: {
|
query: {
|
||||||
query: this.$route.query.query,
|
query: this.$route.query.query,
|
||||||
type: 'album'
|
type: type
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
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'
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user