Users
diff --git a/client/store/index.js b/client/store/index.js
index 6d38ab77..2eafacc3 100644
--- a/client/store/index.js
+++ b/client/store/index.js
@@ -15,7 +15,9 @@ export const state = () => ({
coverScanProgress: null,
developerMode: false,
selectedAudiobooks: [],
- processingBatch: false
+ processingBatch: false,
+ previousPath: '/',
+ routeHistory: []
})
export const getters = {
@@ -52,10 +54,25 @@ export const actions = {
console.error('Update check failed', error)
return false
})
+ },
+ popRoute({ commit, state }) {
+ if (!state.routeHistory.length) {
+ return null
+ }
+ var _history = [...state.routeHistory]
+ var last = _history.pop()
+ commit('setRouteHistory', _history)
+ return last
}
}
export const mutations = {
+ setRouteHistory(state, val) {
+ state.routeHistory = val
+ },
+ setPreviousPath(state, val) {
+ state.previousPath = val
+ },
setVersionData(state, versionData) {
state.versionData = versionData
},
diff --git a/package.json b/package.json
index 70c754c9..1b778307 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "audiobookshelf",
- "version": "1.2.6",
+ "version": "1.2.7",
"description": "Self-hosted audiobook server for managing and playing audiobooks",
"main": "index.js",
"scripts": {
diff --git a/server/objects/Audiobook.js b/server/objects/Audiobook.js
index e6ad651d..c2382251 100644
--- a/server/objects/Audiobook.js
+++ b/server/objects/Audiobook.js
@@ -488,7 +488,6 @@ class Audiobook {
setChapters() {
// If 1 audio file without chapters, then no chapters will be set
-
var includedAudioFiles = this.audioFiles.filter(af => !af.exclude)
if (includedAudioFiles.length === 1) {
// 1 audio file with chapters
@@ -524,7 +523,7 @@ class Audiobook {
id: currChapterId++,
start: currStartTime,
end: currStartTime + file.duration,
- title: `Chapter ${currChapterId}`
+ title: file.filename ? Path.basename(file.filename, Path.extname(file.filename)) : `Chapter ${currChapterId}`
})
currStartTime += file.duration
}