Compare commits

..

4 Commits

Author SHA1 Message Date
advplyr d9b206fe1c Fix server crash when quick match all updates existing series sequence #3961 2025-02-14 16:56:37 -06:00
advplyr fe4e0145c9 Merge pull request #3984 from advplyr/fix-chapter-end-sleep-timer
Fix chapter end sleep timer sometimes not stopping #3969
2025-02-14 16:39:26 -06:00
advplyr c4d99a118f Fix chapter end sleep timer sometimes not stopping #3969 2025-02-14 16:24:39 -06:00
advplyr b96226966b Merge pull request #3980 from advplyr/stringify_sequelize_query
Fix count cache by stringify Symbols #3979
2025-02-13 18:24:36 -06:00
3 changed files with 13 additions and 14 deletions
+12 -7
View File
@@ -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,12 +237,16 @@ 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) {
this.sleepTimerEnd() // 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() { sleepTimerEnd() {
@@ -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) {
+1 -1
View File
@@ -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']
} }
} }
] ]
-6
View File
@@ -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