mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-31 11:38:47 -05:00
Compare commits
4 Commits
stringify_
...
fix-quick-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9b206fe1c | ||
|
|
fe4e0145c9 | ||
|
|
c4d99a118f | ||
|
|
b96226966b |
@@ -85,7 +85,8 @@ export default {
|
||||
displayTitle: null,
|
||||
currentPlaybackRate: 1,
|
||||
syncFailedToast: null,
|
||||
coverAspectRatio: 1
|
||||
coverAspectRatio: 1,
|
||||
lastChapterId: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -236,12 +237,16 @@ export default {
|
||||
}
|
||||
}, 1000)
|
||||
},
|
||||
checkChapterEnd(time) {
|
||||
checkChapterEnd() {
|
||||
if (!this.currentChapter) return
|
||||
const chapterEndTime = this.currentChapter.end
|
||||
const tolerance = 0.75
|
||||
if (time >= chapterEndTime - tolerance) {
|
||||
this.sleepTimerEnd()
|
||||
|
||||
// Track chapter transitions by comparing current chapter with last chapter
|
||||
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.lastChapterId = this.currentChapter.id
|
||||
}
|
||||
},
|
||||
sleepTimerEnd() {
|
||||
@@ -301,7 +306,7 @@ export default {
|
||||
}
|
||||
|
||||
if (this.sleepTimerType === this.$constants.SleepTimerTypes.CHAPTER && this.sleepTimerSet) {
|
||||
this.checkChapterEnd(time)
|
||||
this.checkChapterEnd()
|
||||
}
|
||||
},
|
||||
setDuration(duration) {
|
||||
|
||||
@@ -103,7 +103,7 @@ class LibraryItem extends Model {
|
||||
{
|
||||
model: this.sequelize.models.series,
|
||||
through: {
|
||||
attributes: ['sequence', 'createdAt']
|
||||
attributes: ['id', 'sequence', 'createdAt']
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -48,13 +48,7 @@ class Scanner {
|
||||
let updatePayload = {}
|
||||
let hasUpdated = false
|
||||
|
||||
let existingAuthors = [] // Used for checking if authors or series are now empty
|
||||
let existingSeries = []
|
||||
|
||||
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 searchASIN = options.asin || libraryItem.media.asin
|
||||
|
||||
|
||||
Reference in New Issue
Block a user