mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-23 20:25:44 +02:00
Fix crash downloading with old server, check server version to append token on image requests #1450
This commit is contained in:
parent
08651d28ef
commit
c79ecbb92e
4 changed files with 34 additions and 7 deletions
|
@ -56,11 +56,15 @@ export default {
|
|||
},
|
||||
imgSrc() {
|
||||
if (!this.imagePath || !this.serverAddress) return null
|
||||
const urlQuery = new URLSearchParams({ ts: this.updatedAt })
|
||||
if (this.$store.getters.getDoesServerImagesRequireToken) {
|
||||
urlQuery.append('token', this.$store.getters['user/getToken'])
|
||||
}
|
||||
if (process.env.NODE_ENV !== 'production' && this.serverAddress.startsWith('http://192.168')) {
|
||||
// Testing
|
||||
return `http://localhost:3333/api/authors/${this.authorId}/image?ts=${this.updatedAt}`
|
||||
return `http://localhost:3333/api/authors/${this.authorId}/image?${urlQuery.toString()}`
|
||||
}
|
||||
return `${this.serverAddress}/api/authors/${this.authorId}/image?ts=${this.updatedAt}`
|
||||
return `${this.serverAddress}/api/authors/${this.authorId}/image?${urlQuery.toString()}`
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue