search
close
@@ -51,6 +53,19 @@ export default {
}
},
methods: {
+ submitSearch() {
+ if (!this.search) return
+ this.$router.push(`/library/search?query=${this.search}`)
+
+ this.search = null
+ this.items = []
+ this.showMenu = false
+ this.$nextTick(() => {
+ if (this.$refs.input) {
+ this.$refs.input.blur()
+ }
+ })
+ },
focussed() {
this.isFocused = true
this.showMenu = true
@@ -73,6 +88,10 @@ export default {
return []
})
this.isFetching = false
+ if (!this.showMenu) {
+ return
+ }
+
this.items = results.map((res) => {
return {
id: res.id,
diff --git a/client/components/modals/ChaptersModal.vue b/client/components/modals/ChaptersModal.vue
index 0f0be2f9..e5a01c68 100644
--- a/client/components/modals/ChaptersModal.vue
+++ b/client/components/modals/ChaptersModal.vue
@@ -1,11 +1,13 @@
-
+
-
+
{{ chap.title }}
{{ $secondsToTimestamp(chap.start) }}
+
+
@@ -28,6 +30,11 @@ export default {
data() {
return {}
},
+ watch: {
+ value(newVal) {
+ this.$nextTick(this.scrollToChapter)
+ }
+ },
computed: {
show: {
get() {
@@ -44,8 +51,20 @@ export default {
methods: {
clickChapter(chap) {
this.$emit('select', chap)
+ },
+ scrollToChapter() {
+ if (!this.currentChapterId) return
+
+ var container = this.$refs.container
+ if (container) {
+ var currChapterEl = document.getElementById(`chapter-row-${this.currentChapterId}`)
+ if (currChapterEl) {
+ var offsetTop = currChapterEl.offsetTop
+ var containerHeight = container.clientHeight
+ container.scrollTo({ top: offsetTop - containerHeight / 2 })
+ }
+ }
}
- },
- mounted() {}
+ }
}
\ No newline at end of file
diff --git a/client/components/ui/TextInput.vue b/client/components/ui/TextInput.vue
index 8491c98c..7631a6a0 100644
--- a/client/components/ui/TextInput.vue
+++ b/client/components/ui/TextInput.vue
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/client/plugins/version.js b/client/plugins/version.js
index c8518d26..d09b7afc 100644
--- a/client/plugins/version.js
+++ b/client/plugins/version.js
@@ -5,7 +5,7 @@ function parseSemver(ver) {
if (!ver) return null
var groups = ver.match(/^v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$/)
if (groups && groups.length > 6) {
- var total = Number(groups[3]) * 100 + Number(groups[4]) * 10 + Number(groups[5])
+ var total = Number(groups[3]) * 10000 + Number(groups[4]) * 100 + Number(groups[5])
if (isNaN(total)) {
console.warn('Invalid version total', groups[3], groups[4], groups[5])
return null
diff --git a/package.json b/package.json
index 29b64043..21775ec2 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "audiobookshelf",
- "version": "1.2.0",
+ "version": "1.2.1",
"description": "Self-hosted audiobook server for managing and playing audiobooks.",
"main": "index.js",
"scripts": {
diff --git a/server/Scanner.js b/server/Scanner.js
index 1b67505f..51d5b90e 100644
--- a/server/Scanner.js
+++ b/server/Scanner.js
@@ -100,7 +100,12 @@ class Scanner {
hasUpdatedAudioFiles = true
}
} else {
- newAudioFiles.push(file)
+ var audioFileWithMatchingPath = existingAudiobook.getAudioFileByPath(file.fullPath)
+ if (audioFileWithMatchingPath) {
+ Logger.warn(`[Scanner] Audio file with path already exists with different inode, New: "${file.filename}" (${file.ino}) | Existing: ${audioFileWithMatchingPath.filename} (${audioFileWithMatchingPath.ino})`)
+ } else {
+ newAudioFiles.push(file)
+ }
}
})
if (newAudioFiles.length) {
diff --git a/server/objects/Audiobook.js b/server/objects/Audiobook.js
index de579261..864be331 100644
--- a/server/objects/Audiobook.js
+++ b/server/objects/Audiobook.js
@@ -425,6 +425,10 @@ class Audiobook {
return this.audioFiles.find(af => af.ino === ino)
}
+ getAudioFileByPath(fullPath) {
+ return this.audioFiles.find(af => af.fullPath === fullPath)
+ }
+
setChapters() {
// If 1 audio file without chapters, then no chapters will be set