mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-16 06:11:38 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
b3f9a40f18
227 changed files with 11338 additions and 3382 deletions
|
|
@ -32,11 +32,50 @@ export const state = () => ({
|
|||
text: 'DD/MM/YYYY',
|
||||
value: 'dd/MM/yyyy'
|
||||
},
|
||||
{
|
||||
text: 'DD.MM.YYYY',
|
||||
value: 'dd.MM.yyyy'
|
||||
},
|
||||
{
|
||||
text: 'YYYY-MM-DD',
|
||||
value: 'yyyy-MM-dd'
|
||||
},
|
||||
{
|
||||
text: 'MMM do, yyyy',
|
||||
value: 'MMM do, yyyy'
|
||||
},
|
||||
{
|
||||
text: 'MMMM do, yyyy',
|
||||
value: 'MMMM do, yyyy'
|
||||
},
|
||||
{
|
||||
text: 'dd MMM yyyy',
|
||||
value: 'dd MMM yyyy'
|
||||
},
|
||||
{
|
||||
text: 'dd MMMM yyyy',
|
||||
value: 'dd MMMM yyyy'
|
||||
}
|
||||
],
|
||||
timeFormats: [
|
||||
{
|
||||
text: 'h:mma (am/pm)',
|
||||
value: 'h:mma'
|
||||
},
|
||||
{
|
||||
text: 'HH:mm (24-hour)',
|
||||
value: 'HH:mm'
|
||||
}
|
||||
],
|
||||
podcastTypes: [
|
||||
{ text: 'Episodic', value: 'episodic' },
|
||||
{ text: 'Serial', value: 'serial' }
|
||||
],
|
||||
episodeTypes: [
|
||||
{ text: 'Full', value: 'full' },
|
||||
{ text: 'Trailer', value: 'trailer' },
|
||||
{ text: 'Bonus', value: 'bonus' }
|
||||
],
|
||||
libraryIcons: ['database', 'audiobookshelf', 'books-1', 'books-2', 'book-1', 'microphone-1', 'microphone-3', 'radio', 'podcast', 'rss', 'headphones', 'music', 'file-picture', 'rocket', 'power', 'star', 'heart']
|
||||
})
|
||||
|
||||
|
|
@ -60,14 +99,14 @@ export const getters = {
|
|||
|
||||
return `${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}&ts=${lastUpdate}`
|
||||
},
|
||||
getLibraryItemCoverSrcById: (state, getters, rootState, rootGetters) => (libraryItemId, placeholder = null) => {
|
||||
getLibraryItemCoverSrcById: (state, getters, rootState, rootGetters) => (libraryItemId, placeholder = null, raw = false) => {
|
||||
if (!placeholder) placeholder = `${rootState.routerBasePath}/book_placeholder.jpg`
|
||||
if (!libraryItemId) return placeholder
|
||||
var userToken = rootGetters['user/getToken']
|
||||
if (process.env.NODE_ENV !== 'production') { // Testing
|
||||
return `http://localhost:3333${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}`
|
||||
return `http://localhost:3333${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}${raw ? '&raw=1' : ''}`
|
||||
}
|
||||
return `${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}`
|
||||
return `${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}${raw ? '&raw=1' : ''}`
|
||||
},
|
||||
getIsBatchSelectingMediaItems: (state) => {
|
||||
return state.selectedMediaItems.length
|
||||
|
|
@ -169,4 +208,4 @@ export const mutations = {
|
|||
state.selectedMediaItems.push(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ export const state = () => ({
|
|||
Source: null,
|
||||
versionData: null,
|
||||
serverSettings: null,
|
||||
playbackSessionId: null,
|
||||
streamLibraryItem: null,
|
||||
streamEpisodeId: null,
|
||||
streamIsPlaying: false,
|
||||
|
|
@ -13,6 +14,7 @@ export const state = () => ({
|
|||
playerQueueAutoPlay: true,
|
||||
playerIsFullscreen: false,
|
||||
editModalTab: 'details',
|
||||
editPodcastModalTab: 'details',
|
||||
showEditModal: false,
|
||||
showEReader: false,
|
||||
selectedLibraryItem: null,
|
||||
|
|
@ -22,6 +24,7 @@ export const state = () => ({
|
|||
showExperimentalFeatures: false,
|
||||
defaultRenameString: '',
|
||||
bookshelfBookIds: [],
|
||||
episodeTableEpisodeIds: [],
|
||||
openModal: null,
|
||||
innerModalOpen: false,
|
||||
lastBookshelfScrollData: {},
|
||||
|
|
@ -34,7 +37,7 @@ export const getters = {
|
|||
return state.serverSettings[key]
|
||||
},
|
||||
getLibraryItemIdStreaming: state => {
|
||||
return state.streamLibraryItem ? state.streamLibraryItem.id : null
|
||||
return state.streamLibraryItem?.id || null
|
||||
},
|
||||
getIsStreamingFromDifferentLibrary: (state, getters, rootState) => {
|
||||
if (!state.streamLibraryItem) return false
|
||||
|
|
@ -136,6 +139,9 @@ export const mutations = {
|
|||
setBookshelfBookIds(state, val) {
|
||||
state.bookshelfBookIds = val || []
|
||||
},
|
||||
setEpisodeTableEpisodeIds(state, val) {
|
||||
state.episodeTableEpisodeIds = val || []
|
||||
},
|
||||
setPreviousPath(state, val) {
|
||||
state.previousPath = val
|
||||
},
|
||||
|
|
@ -146,6 +152,9 @@ export const mutations = {
|
|||
if (!settings) return
|
||||
state.serverSettings = settings
|
||||
},
|
||||
setPlaybackSessionId(state, playbackSessionId) {
|
||||
state.playbackSessionId = playbackSessionId
|
||||
},
|
||||
setMediaPlaying(state, payload) {
|
||||
if (!payload) {
|
||||
state.streamLibraryItem = null
|
||||
|
|
@ -199,6 +208,9 @@ export const mutations = {
|
|||
setShowEditModal(state, val) {
|
||||
state.showEditModal = val
|
||||
},
|
||||
setEditPodcastModalTab(state, tab) {
|
||||
state.editPodcastModalTab = tab
|
||||
},
|
||||
showEReader(state, libraryItem) {
|
||||
state.selectedLibraryItem = libraryItem
|
||||
|
||||
|
|
@ -230,4 +242,4 @@ export const mutations = {
|
|||
setInnerModalOpen(state, val) {
|
||||
state.innerModalOpen = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ export const state = () => ({
|
|||
filterData: null,
|
||||
numUserPlaylists: 0,
|
||||
collections: [],
|
||||
userPlaylists: []
|
||||
userPlaylists: [],
|
||||
ereaderDevices: []
|
||||
})
|
||||
|
||||
export const getters = {
|
||||
|
|
@ -339,5 +340,8 @@ export const mutations = {
|
|||
removeUserPlaylist(state, playlist) {
|
||||
state.userPlaylists = state.userPlaylists.filter(p => p.id !== playlist.id)
|
||||
state.numUserPlaylists = state.userPlaylists.length
|
||||
},
|
||||
setEReaderDevices(state, ereaderDevices) {
|
||||
state.ereaderDevices = ereaderDevices
|
||||
}
|
||||
}
|
||||
|
|
@ -63,6 +63,12 @@ export const state = () => ({
|
|||
text: 'iTunes',
|
||||
value: 'itunes'
|
||||
}
|
||||
],
|
||||
coverOnlyProviders: [
|
||||
{
|
||||
text: 'AudiobookCovers.com',
|
||||
value: 'audiobookcovers'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
|
||||
export const state = () => ({
|
||||
tasks: []
|
||||
tasks: [],
|
||||
queuedEmbedLIds: []
|
||||
})
|
||||
|
||||
export const getters = {
|
||||
getTaskByLibraryItemId: (state) => (libraryItemId) => {
|
||||
return state.tasks.find(t => t.data && t.data.libraryItemId === libraryItemId)
|
||||
getTasksByLibraryItemId: (state) => (libraryItemId) => {
|
||||
return state.tasks.filter(t => t.data && t.data.libraryItemId === libraryItemId)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -18,14 +19,31 @@ export const mutations = {
|
|||
state.tasks = tasks
|
||||
},
|
||||
addUpdateTask(state, task) {
|
||||
var index = state.tasks.findIndex(d => d.id === task.id)
|
||||
const index = state.tasks.findIndex(d => d.id === task.id)
|
||||
if (index >= 0) {
|
||||
state.tasks.splice(index, 1, task)
|
||||
} else {
|
||||
// Remove duplicate (only have one library item per action)
|
||||
state.tasks = state.tasks.filter(_task => {
|
||||
if (!_task.data?.libraryItemId || _task.action !== task.action) return true
|
||||
return _task.data.libraryItemId !== task.data.libraryItemId
|
||||
})
|
||||
|
||||
state.tasks.push(task)
|
||||
}
|
||||
},
|
||||
removeTask(state, task) {
|
||||
state.tasks = state.tasks.filter(d => d.id !== task.id)
|
||||
},
|
||||
setQueuedEmbedLIds(state, libraryItemIds) {
|
||||
state.queuedEmbedLIds = libraryItemIds
|
||||
},
|
||||
addQueuedEmbedLId(state, libraryItemId) {
|
||||
if (!state.queuedEmbedLIds.some(lid => lid === libraryItemId)) {
|
||||
state.queuedEmbedLIds.push(libraryItemId)
|
||||
}
|
||||
},
|
||||
removeQueuedEmbedLId(state, libraryItemId) {
|
||||
state.queuedEmbedLIds = state.queuedEmbedLIds.filter(lid => lid !== libraryItemId)
|
||||
}
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ export const getters = {
|
|||
getIsRoot: (state) => state.user && state.user.type === 'root',
|
||||
getIsAdminOrUp: (state) => state.user && (state.user.type === 'admin' || state.user.type === 'root'),
|
||||
getToken: (state) => {
|
||||
return state.user ? state.user.token : null
|
||||
return state.user?.token || null
|
||||
},
|
||||
getUserMediaProgress: (state) => (libraryItemId, episodeId = null) => {
|
||||
if (!state.user.mediaProgress) return null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue