mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-02 00:54:30 +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
|
@ -1,3 +1,5 @@
|
|||
const { BookCoverAspectRatio } = require('../plugins/constants')
|
||||
|
||||
export const state = () => ({
|
||||
libraries: [],
|
||||
lastLoad: 0,
|
||||
|
@ -18,6 +20,14 @@ export const getters = {
|
|||
getCurrentLibraryMediaType: (state, getters) => {
|
||||
var currLib = getters.getCurrentLibrary
|
||||
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