Fix bug in readers where web browser is unable to load the ebook when running behind a reverse proxy at /audiobookshelf

This commit is contained in:
Kareem Ahmad 2026-03-18 22:07:22 -04:00
parent 4bdd76d94c
commit a926df3aae
4 changed files with 11 additions and 11 deletions

View file

@ -109,9 +109,9 @@ export default {
}, },
ebookUrl() { ebookUrl() {
if (this.fileId) { if (this.fileId) {
return `/api/items/${this.libraryItemId}/ebook/${this.fileId}` return `/audiobookshelf/api/items/${this.libraryItemId}/ebook/${this.fileId}`
} }
return `/api/items/${this.libraryItemId}/ebook` return `/audiobookshelf/api/items/${this.libraryItemId}/ebook`
}, },
comicMetadataKeys() { comicMetadataKeys() {
return this.comicMetadata ? Object.keys(this.comicMetadata) : [] return this.comicMetadata ? Object.keys(this.comicMetadata) : []
@ -176,7 +176,7 @@ export default {
ebookLocation: this.page, ebookLocation: this.page,
ebookProgress: Math.max(0, Math.min(1, (Number(this.page) - 1) / Number(this.numPages))) ebookProgress: Math.max(0, Math.min(1, (Number(this.page) - 1) / Number(this.numPages)))
} }
this.$axios.$patch(`/api/me/progress/${this.libraryItemId}`, payload, { progress: false }).catch((error) => { this.$axios.$patch(`/audiobookshelf/api/me/progress/${this.libraryItemId}`, payload, { progress: false }).catch((error) => {
console.error('ComicReader.updateProgress failed:', error) console.error('ComicReader.updateProgress failed:', error)
}) })
}, },

View file

@ -94,9 +94,9 @@ export default {
}, },
ebookUrl() { ebookUrl() {
if (this.fileId) { if (this.fileId) {
return `/api/items/${this.libraryItemId}/ebook/${this.fileId}` return `/audiobookshelf/api/items/${this.libraryItemId}/ebook/${this.fileId}`
} }
return `/api/items/${this.libraryItemId}/ebook` return `/audiobookshelf/api/items/${this.libraryItemId}/ebook`
}, },
themeRules() { themeRules() {
const theme = this.ereaderSettings.theme const theme = this.ereaderSettings.theme
@ -206,7 +206,7 @@ export default {
*/ */
updateProgress(payload) { updateProgress(payload) {
if (!this.keepProgress) return if (!this.keepProgress) return
this.$axios.$patch(`/api/me/progress/${this.libraryItemId}`, payload, { progress: false }).catch((error) => { this.$axios.$patch(`/audiobookshelf/api/me/progress/${this.libraryItemId}`, payload, { progress: false }).catch((error) => {
console.error('EpubReader.updateProgress failed:', error) console.error('EpubReader.updateProgress failed:', error)
}) })
}, },

View file

@ -31,9 +31,9 @@ export default {
}, },
ebookUrl() { ebookUrl() {
if (this.fileId) { if (this.fileId) {
return `/api/items/${this.libraryItemId}/ebook/${this.fileId}` return `/audiobookshelf/api/items/${this.libraryItemId}/ebook/${this.fileId}`
} }
return `/api/items/${this.libraryItemId}/ebook` return `/audiobookshelf/api/items/${this.libraryItemId}/ebook`
} }
}, },
methods: { methods: {

View file

@ -104,9 +104,9 @@ export default {
}, },
ebookUrl() { ebookUrl() {
if (this.fileId) { if (this.fileId) {
return `/api/items/${this.libraryItemId}/ebook/${this.fileId}` return `/audiobookshelf/api/items/${this.libraryItemId}/ebook/${this.fileId}`
} }
return `/api/items/${this.libraryItemId}/ebook` return `/audiobookshelf/api/items/${this.libraryItemId}/ebook`
} }
}, },
methods: { methods: {
@ -127,7 +127,7 @@ export default {
ebookLocation: this.page, ebookLocation: this.page,
ebookProgress: Math.max(0, Math.min(1, (Number(this.page) - 1) / Number(this.numPages))) ebookProgress: Math.max(0, Math.min(1, (Number(this.page) - 1) / Number(this.numPages)))
} }
this.$axios.$patch(`/api/me/progress/${this.libraryItemId}`, payload, { progress: false }).catch((error) => { this.$axios.$patch(`/audiobookshelf/api/me/progress/${this.libraryItemId}`, payload, { progress: false }).catch((error) => {
console.error('EpubReader.updateProgress failed:', error) console.error('EpubReader.updateProgress failed:', error)
}) })
}, },