mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-08 13:04:41 +02:00
Update:Use cover aspect ratio from library setting
This commit is contained in:
parent
3c9b8c1c6f
commit
a852114e9c
13 changed files with 22 additions and 15 deletions
|
@ -205,7 +205,7 @@ export default {
|
||||||
return this.$store.getters['getJumpBackwardsTime']
|
return this.$store.getters['getJumpBackwardsTime']
|
||||||
},
|
},
|
||||||
bookCoverAspectRatio() {
|
bookCoverAspectRatio() {
|
||||||
return this.$store.getters['getBookCoverAspectRatio']
|
return this.$store.getters['libraries/getBookCoverAspectRatio']
|
||||||
},
|
},
|
||||||
bookCoverWidth() {
|
bookCoverWidth() {
|
||||||
if (this.showFullscreen) return this.fullscreenBookCoverWidth
|
if (this.showFullscreen) return this.fullscreenBookCoverWidth
|
||||||
|
|
|
@ -89,7 +89,7 @@ export default {
|
||||||
return this.bookCoverAspectRatio === 1
|
return this.bookCoverAspectRatio === 1
|
||||||
},
|
},
|
||||||
bookCoverAspectRatio() {
|
bookCoverAspectRatio() {
|
||||||
return this.$store.getters['getBookCoverAspectRatio']
|
return this.$store.getters['libraries/getBookCoverAspectRatio']
|
||||||
},
|
},
|
||||||
bookWidth() {
|
bookWidth() {
|
||||||
var coverSize = 100
|
var coverSize = 100
|
||||||
|
|
|
@ -69,7 +69,7 @@ export default {
|
||||||
return this.bookCoverAspectRatio === 1
|
return this.bookCoverAspectRatio === 1
|
||||||
},
|
},
|
||||||
bookCoverAspectRatio() {
|
bookCoverAspectRatio() {
|
||||||
return this.$store.getters['getBookCoverAspectRatio']
|
return this.$store.getters['libraries/getBookCoverAspectRatio']
|
||||||
},
|
},
|
||||||
altViewEnabled() {
|
altViewEnabled() {
|
||||||
return this.$store.getters['getAltViewEnabled']
|
return this.$store.getters['getAltViewEnabled']
|
||||||
|
|
|
@ -31,7 +31,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
bookCoverAspectRatio() {
|
bookCoverAspectRatio() {
|
||||||
return this.$store.getters['getBookCoverAspectRatio']
|
return this.$store.getters['libraries/getBookCoverAspectRatio']
|
||||||
},
|
},
|
||||||
coverWidth() {
|
coverWidth() {
|
||||||
if (this.bookCoverAspectRatio === 1) return 50 * 1.2
|
if (this.bookCoverAspectRatio === 1) return 50 * 1.2
|
||||||
|
|
|
@ -24,7 +24,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
bookCoverAspectRatio() {
|
bookCoverAspectRatio() {
|
||||||
return this.$store.getters['getBookCoverAspectRatio']
|
return this.$store.getters['libraries/getBookCoverAspectRatio']
|
||||||
},
|
},
|
||||||
name() {
|
name() {
|
||||||
return this.series.name
|
return this.series.name
|
||||||
|
|
|
@ -40,7 +40,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
bookCoverAspectRatio() {
|
bookCoverAspectRatio() {
|
||||||
return this.$store.getters['getBookCoverAspectRatio']
|
return this.$store.getters['libraries/getBookCoverAspectRatio']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -50,7 +50,7 @@ export default {
|
||||||
return this.$elapsedPretty(this.media.duration)
|
return this.$elapsedPretty(this.media.duration)
|
||||||
},
|
},
|
||||||
bookCoverAspectRatio() {
|
bookCoverAspectRatio() {
|
||||||
return this.$store.getters['getBookCoverAspectRatio']
|
return this.$store.getters['libraries/getBookCoverAspectRatio']
|
||||||
},
|
},
|
||||||
bookWidth() {
|
bookWidth() {
|
||||||
if (this.bookCoverAspectRatio === 1) return 50
|
if (this.bookCoverAspectRatio === 1) return 50
|
||||||
|
|
|
@ -58,7 +58,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
bookCoverAspectRatio() {
|
bookCoverAspectRatio() {
|
||||||
return this.$store.getters['getBookCoverAspectRatio']
|
return this.$store.getters['libraries/getBookCoverAspectRatio']
|
||||||
},
|
},
|
||||||
bookItems() {
|
bookItems() {
|
||||||
return this.collection.books || []
|
return this.collection.books || []
|
||||||
|
|
|
@ -199,7 +199,7 @@ export default {
|
||||||
return null
|
return null
|
||||||
},
|
},
|
||||||
bookCoverAspectRatio() {
|
bookCoverAspectRatio() {
|
||||||
return this.$store.getters['getBookCoverAspectRatio']
|
return this.$store.getters['libraries/getBookCoverAspectRatio']
|
||||||
},
|
},
|
||||||
libraryItemId() {
|
libraryItemId() {
|
||||||
return this.libraryItem.id
|
return this.libraryItem.id
|
||||||
|
|
|
@ -68,7 +68,7 @@ export default {
|
||||||
return this.$store.state.libraries.currentLibraryId
|
return this.$store.state.libraries.currentLibraryId
|
||||||
},
|
},
|
||||||
bookCoverAspectRatio() {
|
bookCoverAspectRatio() {
|
||||||
return this.$store.getters['getBookCoverAspectRatio']
|
return this.$store.getters['libraries/getBookCoverAspectRatio']
|
||||||
},
|
},
|
||||||
totalResults() {
|
totalResults() {
|
||||||
return this.bookResults.length + this.seriesResults.length + this.authorResults.length + this.podcastResults.length
|
return this.bookResults.length + this.seriesResults.length + this.authorResults.length + this.podcastResults.length
|
||||||
|
|
|
@ -45,7 +45,8 @@ const Constants = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
PlayerState
|
PlayerState,
|
||||||
|
BookCoverAspectRatio
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ({ app }, inject) => {
|
export default ({ app }, inject) => {
|
||||||
|
|
|
@ -36,10 +36,6 @@ export const getters = {
|
||||||
if (!state.serverSettings) return null
|
if (!state.serverSettings) return null
|
||||||
return state.serverSettings[key]
|
return state.serverSettings[key]
|
||||||
},
|
},
|
||||||
getBookCoverAspectRatio: state => {
|
|
||||||
if (!state.serverSettings) return 1
|
|
||||||
return state.serverSettings.coverAspectRatio === 0 ? 1.6 : 1
|
|
||||||
},
|
|
||||||
getJumpForwardTime: state => {
|
getJumpForwardTime: state => {
|
||||||
if (!state.deviceData || !state.deviceData.deviceSettings) return 10
|
if (!state.deviceData || !state.deviceData.deviceSettings) return 10
|
||||||
return state.deviceData.deviceSettings.jumpForwardTime || 10
|
return state.deviceData.deviceSettings.jumpForwardTime || 10
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
const { BookCoverAspectRatio } = require('../plugins/constants')
|
||||||
|
|
||||||
export const state = () => ({
|
export const state = () => ({
|
||||||
libraries: [],
|
libraries: [],
|
||||||
lastLoad: 0,
|
lastLoad: 0,
|
||||||
|
@ -18,6 +20,14 @@ export const getters = {
|
||||||
getCurrentLibraryMediaType: (state, getters) => {
|
getCurrentLibraryMediaType: (state, getters) => {
|
||||||
var currLib = getters.getCurrentLibrary
|
var currLib = getters.getCurrentLibrary
|
||||||
return currLib ? currLib.mediaType : null
|
return currLib ? currLib.mediaType : null
|
||||||
|
},
|
||||||
|
getCurrentLibrarySettings: (state, getters) => {
|
||||||
|
if (!getters.getCurrentLibrary) return null
|
||||||
|
return getters.getCurrentLibrary.settings
|
||||||
|
},
|
||||||
|
getBookCoverAspectRatio: (state, getters) => {
|
||||||
|
if (!getters.getCurrentLibrarySettings || isNaN(getters.getCurrentLibrarySettings.coverAspectRatio)) return 1
|
||||||
|
return getters.getCurrentLibrarySettings.coverAspectRatio === BookCoverAspectRatio.STANDARD ? 1.6 : 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue