mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-05 02:34:56 +02:00
Fix:Authors page includes library id in url #1767
This commit is contained in:
parent
bac09de23d
commit
b8b3d05f5e
6 changed files with 11 additions and 7 deletions
|
@ -43,8 +43,8 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
async asyncData({ store, app, params, redirect }) {
|
||||
const author = await app.$axios.$get(`/api/authors/${params.id}?library=${store.state.libraries.currentLibraryId}&include=items,series`).catch((error) => {
|
||||
async asyncData({ store, app, params, redirect, query }) {
|
||||
const author = await app.$axios.$get(`/api/authors/${params.id}?library=${query.library || store.state.libraries.currentLibraryId}&include=items,series`).catch((error) => {
|
||||
console.error('Failed to get author', error)
|
||||
return null
|
||||
})
|
||||
|
@ -53,6 +53,10 @@ export default {
|
|||
return redirect(`/library/${store.state.libraries.currentLibraryId}/authors`)
|
||||
}
|
||||
|
||||
if (query.library) {
|
||||
store.commit('libraries/setCurrentLibrary', query.library)
|
||||
}
|
||||
|
||||
return {
|
||||
author
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<nuxt-link v-for="(artist, index) in musicArtists" :key="index" :to="`/artist/${$encode(artist)}`" class="hover:underline">{{ artist }}<span v-if="index < musicArtists.length - 1">, </span></nuxt-link>
|
||||
</p>
|
||||
<p v-else-if="authors.length" class="mb-2 mt-0.5 text-gray-200 text-lg md:text-xl max-w-[calc(100vw-2rem)] overflow-hidden overflow-ellipsis">
|
||||
by <nuxt-link v-for="(author, index) in authors" :key="index" :to="`/author/${author.id}`" class="hover:underline">{{ author.name }}<span v-if="index < authors.length - 1">, </span></nuxt-link>
|
||||
by <nuxt-link v-for="(author, index) in authors" :key="index" :to="`/author/${author.id}?library=${libraryItem.libraryId}`" class="hover:underline">{{ author.name }}<span v-if="index < authors.length - 1">, </span></nuxt-link>
|
||||
</p>
|
||||
<p v-else class="mb-2 mt-0.5 text-gray-200 text-xl">by Unknown</p>
|
||||
</template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue