Skip to content

Commit

Permalink
Merge pull request #1132 from TortugaPower/fix-timer-endchapter
Browse files Browse the repository at this point in the history
  • Loading branch information
GianniCarlo authored Apr 21, 2024
2 parents 380bc7d + 3bbf20e commit 54ef0f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
4 changes: 3 additions & 1 deletion BookPlayer/Player/PlayerManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@ final class PlayerManager: NSObject, PlayerManagerProtocol {
if currentItem.isBoundBook {
currentTime += currentItem.currentChapter.start
} else if currentTime >= currentItem.currentChapter.end || currentTime < currentItem.currentChapter.start,
let newChapter = currentItem.getChapter(at: currentTime) {
let newChapter = currentItem.getChapter(at: currentTime),
newChapter != currentItem.currentChapter {
/// Avoid setting the same chapter, as it would publish an update event
currentItem.currentChapter = newChapter
}

Expand Down

0 comments on commit 54ef0f0

Please sign in to comment.