mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-21 11:14:38 +02:00
feat: now playing chapter track
This commit is contained in:
parent
793f0c05f7
commit
2b1667e532
11 changed files with 91 additions and 11 deletions
|
@ -160,3 +160,11 @@ class PlaybackSession: Object, Codable, Deletable {
|
|||
try container.encode(localMediaProgressId, forKey: .localMediaProgressId)
|
||||
}
|
||||
}
|
||||
|
||||
extension PlaybackSession {
|
||||
func getCurrentChapter() -> Chapter? {
|
||||
return chapters.first { chapter in
|
||||
chapter.start <= self.currentTime && chapter.end > self.currentTime
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue