mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-04 18:24:46 +02:00
Merge master
This commit is contained in:
commit
ab14b561f5
147 changed files with 4669 additions and 5036 deletions
|
@ -11,6 +11,7 @@ export const state = () => ({
|
|||
showViewPodcastEpisodeModal: false,
|
||||
showRSSFeedOpenCloseModal: false,
|
||||
showConfirmPrompt: false,
|
||||
showRawCoverPreviewModal: false,
|
||||
confirmPromptOptions: null,
|
||||
showEditAuthorModal: false,
|
||||
rssFeedEntity: null,
|
||||
|
@ -20,6 +21,7 @@ export const state = () => ({
|
|||
selectedCollection: null,
|
||||
selectedAuthor: null,
|
||||
selectedMediaItems: [],
|
||||
selectedLibraryItemId: null,
|
||||
isCasting: false, // Actively casting
|
||||
isChromecastInitialized: false, // Script loadeds
|
||||
showBatchQuickMatchModal: false,
|
||||
|
@ -80,7 +82,7 @@ export const state = () => ({
|
|||
})
|
||||
|
||||
export const getters = {
|
||||
getLibraryItemCoverSrc: (state, getters, rootState, rootGetters) => (libraryItem, placeholder = null) => {
|
||||
getLibraryItemCoverSrc: (state, getters, rootState, rootGetters) => (libraryItem, placeholder = null, raw = false) => {
|
||||
if (!placeholder) placeholder = `${rootState.routerBasePath}/book_placeholder.jpg`
|
||||
if (!libraryItem) return placeholder
|
||||
const media = libraryItem.media
|
||||
|
@ -94,7 +96,7 @@ export const getters = {
|
|||
const libraryItemId = libraryItem.libraryItemId || libraryItem.id // Workaround for /users/:id page showing media progress covers
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') { // Testing
|
||||
return `http://localhost:3333${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}&ts=${lastUpdate}`
|
||||
return `http://localhost:3333${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}&ts=${lastUpdate}${raw ? '&raw=1' : ''}`
|
||||
}
|
||||
|
||||
return `${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}&ts=${lastUpdate}`
|
||||
|
@ -156,6 +158,13 @@ export const mutations = {
|
|||
state.confirmPromptOptions = options
|
||||
state.showConfirmPrompt = true
|
||||
},
|
||||
setShowRawCoverPreviewModal(state, val) {
|
||||
state.showRawCoverPreviewModal = val
|
||||
},
|
||||
setRawCoverPreviewModal(state, libraryItemId) {
|
||||
state.selectedLibraryItemId = libraryItemId
|
||||
state.showRawCoverPreviewModal = true
|
||||
},
|
||||
setEditCollection(state, collection) {
|
||||
state.selectedCollection = collection
|
||||
state.showEditCollectionModal = true
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
export const state = () => ({
|
||||
libraryScans: [],
|
||||
providers: [
|
||||
{
|
||||
text: 'Google Books',
|
||||
|
@ -72,26 +71,8 @@ export const state = () => ({
|
|||
]
|
||||
})
|
||||
|
||||
export const getters = {
|
||||
getLibraryScan: state => id => {
|
||||
return state.libraryScans.find(ls => ls.id === id)
|
||||
}
|
||||
}
|
||||
export const getters = {}
|
||||
|
||||
export const actions = {
|
||||
export const actions = {}
|
||||
|
||||
}
|
||||
|
||||
export const mutations = {
|
||||
addUpdate(state, data) {
|
||||
var index = state.libraryScans.findIndex(lib => lib.id === data.id)
|
||||
if (index >= 0) {
|
||||
state.libraryScans.splice(index, 1, data)
|
||||
} else {
|
||||
state.libraryScans.push(data)
|
||||
}
|
||||
},
|
||||
remove(state, data) {
|
||||
state.libraryScans = state.libraryScans.filter(scan => scan.id !== data.id)
|
||||
}
|
||||
}
|
||||
export const mutations = {}
|
|
@ -6,7 +6,11 @@ export const state = () => ({
|
|||
|
||||
export const getters = {
|
||||
getTasksByLibraryItemId: (state) => (libraryItemId) => {
|
||||
return state.tasks.filter(t => t.data && t.data.libraryItemId === libraryItemId)
|
||||
return state.tasks.filter(t => t.data?.libraryItemId === libraryItemId)
|
||||
},
|
||||
getRunningLibraryScanTask: (state) => (libraryId) => {
|
||||
const libraryScanActions = ['library-scan', 'library-match-all']
|
||||
return state.tasks.find(t => libraryScanActions.includes(t.action) && t.data?.libraryId === libraryId && !t.isFinished)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue