mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-06 03:54:50 +02:00
Update:Showing fullscreen cover uses raw cover
This commit is contained in:
parent
ad3fee8907
commit
b4a37fed28
3 changed files with 11 additions and 10 deletions
|
@ -47,7 +47,8 @@ export default {
|
||||||
default: 120
|
default: 120
|
||||||
},
|
},
|
||||||
bookCoverAspectRatio: Number,
|
bookCoverAspectRatio: Number,
|
||||||
downloadCover: String
|
downloadCover: String,
|
||||||
|
raw: Boolean
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -115,7 +116,7 @@ export default {
|
||||||
if (this.downloadCover) return this.downloadCover
|
if (this.downloadCover) return this.downloadCover
|
||||||
if (!this.libraryItem) return null
|
if (!this.libraryItem) return null
|
||||||
var store = this.$store || this.$nuxt.$store
|
var store = this.$store || this.$nuxt.$store
|
||||||
return store.getters['globals/getLibraryItemCoverSrc'](this.libraryItem, this.placeholderUrl)
|
return store.getters['globals/getLibraryItemCoverSrc'](this.libraryItem, this.placeholderUrl, this.raw)
|
||||||
},
|
},
|
||||||
cover() {
|
cover() {
|
||||||
return this.media.coverPath || this.placeholderUrl
|
return this.media.coverPath || this.placeholderUrl
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<modals-modal v-model="show" width="100%" height="100%" max-width="100%">
|
<modals-modal v-model="show" width="100%" height="100%" max-width="100%">
|
||||||
<div class="w-full h-full overflow-hidden absolute top-0 left-0 flex items-center justify-center" @click="show = false">
|
<div class="w-full h-full overflow-hidden absolute top-0 left-0 flex items-center justify-center" @click="show = false">
|
||||||
<covers-book-cover :library-item="libraryItem" :width="width" :book-cover-aspect-ratio="bookCoverAspectRatio" />
|
<covers-book-cover :library-item="libraryItem" :width="width" raw :book-cover-aspect-ratio="bookCoverAspectRatio" />
|
||||||
</div>
|
</div>
|
||||||
</modals-modal>
|
</modals-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -45,26 +45,26 @@ export const getters = {
|
||||||
return i.libraryItemId == libraryItemId
|
return i.libraryItemId == libraryItemId
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getLibraryItemCoverSrc: (state, getters, rootState, rootGetters) => (libraryItem, placeholder = '/book_placeholder.jpg') => {
|
getLibraryItemCoverSrc: (state, getters, rootState, rootGetters) => (libraryItem, placeholder, raw = false) => {
|
||||||
if (!libraryItem) return placeholder
|
if (!libraryItem) return placeholder
|
||||||
var media = libraryItem.media
|
const media = libraryItem.media
|
||||||
if (!media || !media.coverPath || media.coverPath === placeholder) return placeholder
|
if (!media || !media.coverPath || media.coverPath === placeholder) return placeholder
|
||||||
|
|
||||||
// Absolute URL covers (should no longer be used)
|
// Absolute URL covers (should no longer be used)
|
||||||
if (media.coverPath.startsWith('http:') || media.coverPath.startsWith('https:')) return media.coverPath
|
if (media.coverPath.startsWith('http:') || media.coverPath.startsWith('https:')) return media.coverPath
|
||||||
|
|
||||||
var userToken = rootGetters['user/getToken']
|
const userToken = rootGetters['user/getToken']
|
||||||
var serverAddress = rootGetters['user/getServerAddress']
|
const serverAddress = rootGetters['user/getServerAddress']
|
||||||
if (!userToken || !serverAddress) return placeholder
|
if (!userToken || !serverAddress) return placeholder
|
||||||
|
|
||||||
var lastUpdate = libraryItem.updatedAt || Date.now()
|
const lastUpdate = libraryItem.updatedAt || Date.now()
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== 'production') { // Testing
|
if (process.env.NODE_ENV !== 'production') { // Testing
|
||||||
// return `http://localhost:3333/api/items/${libraryItem.id}/cover?token=${userToken}&ts=${lastUpdate}`
|
// return `http://localhost:3333/api/items/${libraryItem.id}/cover?token=${userToken}&ts=${lastUpdate}`
|
||||||
}
|
}
|
||||||
|
|
||||||
var url = new URL(`/api/items/${libraryItem.id}/cover`, serverAddress)
|
const url = new URL(`/api/items/${libraryItem.id}/cover`, serverAddress)
|
||||||
return `${url}?token=${userToken}&ts=${lastUpdate}`
|
return `${url}?token=${userToken}&ts=${lastUpdate}${raw ? '&raw=1' : ''}`
|
||||||
},
|
},
|
||||||
getLocalMediaProgressById: (state) => (localLibraryItemId, episodeId = null) => {
|
getLocalMediaProgressById: (state) => (localLibraryItemId, episodeId = null) => {
|
||||||
return state.localMediaProgress.find(lmp => {
|
return state.localMediaProgress.find(lmp => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue