mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-02 00:40:39 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d9b206fe1c | |||
| fe4e0145c9 | |||
| c4d99a118f | |||
| b96226966b |
@@ -85,7 +85,8 @@ export default {
|
|||||||
displayTitle: null,
|
displayTitle: null,
|
||||||
currentPlaybackRate: 1,
|
currentPlaybackRate: 1,
|
||||||
syncFailedToast: null,
|
syncFailedToast: null,
|
||||||
coverAspectRatio: 1
|
coverAspectRatio: 1,
|
||||||
|
lastChapterId: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -236,13 +237,17 @@ export default {
|
|||||||
}
|
}
|
||||||
}, 1000)
|
}, 1000)
|
||||||
},
|
},
|
||||||
checkChapterEnd(time) {
|
checkChapterEnd() {
|
||||||
if (!this.currentChapter) return
|
if (!this.currentChapter) return
|
||||||
const chapterEndTime = this.currentChapter.end
|
|
||||||
const tolerance = 0.75
|
// Track chapter transitions by comparing current chapter with last chapter
|
||||||
if (time >= chapterEndTime - tolerance) {
|
if (this.lastChapterId !== this.currentChapter.id) {
|
||||||
|
// Chapter changed - if we had a previous chapter, this means we crossed a boundary
|
||||||
|
if (this.lastChapterId) {
|
||||||
this.sleepTimerEnd()
|
this.sleepTimerEnd()
|
||||||
}
|
}
|
||||||
|
this.lastChapterId = this.currentChapter.id
|
||||||
|
}
|
||||||
},
|
},
|
||||||
sleepTimerEnd() {
|
sleepTimerEnd() {
|
||||||
this.clearSleepTimer()
|
this.clearSleepTimer()
|
||||||
@@ -301,7 +306,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.sleepTimerType === this.$constants.SleepTimerTypes.CHAPTER && this.sleepTimerSet) {
|
if (this.sleepTimerType === this.$constants.SleepTimerTypes.CHAPTER && this.sleepTimerSet) {
|
||||||
this.checkChapterEnd(time)
|
this.checkChapterEnd()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setDuration(duration) {
|
setDuration(duration) {
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class LibraryItem extends Model {
|
|||||||
{
|
{
|
||||||
model: this.sequelize.models.series,
|
model: this.sequelize.models.series,
|
||||||
through: {
|
through: {
|
||||||
attributes: ['sequence', 'createdAt']
|
attributes: ['id', 'sequence', 'createdAt']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -48,13 +48,7 @@ class Scanner {
|
|||||||
let updatePayload = {}
|
let updatePayload = {}
|
||||||
let hasUpdated = false
|
let hasUpdated = false
|
||||||
|
|
||||||
let existingAuthors = [] // Used for checking if authors or series are now empty
|
|
||||||
let existingSeries = []
|
|
||||||
|
|
||||||
if (libraryItem.isBook) {
|
if (libraryItem.isBook) {
|
||||||
existingAuthors = libraryItem.media.authors.map((a) => a.id)
|
|
||||||
existingSeries = libraryItem.media.series.map((s) => s.id)
|
|
||||||
|
|
||||||
const searchISBN = options.isbn || libraryItem.media.isbn
|
const searchISBN = options.isbn || libraryItem.media.isbn
|
||||||
const searchASIN = options.asin || libraryItem.media.asin
|
const searchASIN = options.asin || libraryItem.media.asin
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user