mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-19 03:15:58 +02:00
Fix: filter out invalid bookmarks
This commit is contained in:
@@ -22,7 +22,13 @@ class AudiobookProgress {
|
||||
|
||||
bookmarksToJSON() {
|
||||
if (!this.bookmarks) return []
|
||||
return this.bookmarks.map(b => b.toJSON())
|
||||
return this.bookmarks.filter((b) => {
|
||||
if (!b.toJSON) {
|
||||
Logger.error(`[AudiobookProgress] Invalid bookmark ${JSON.stringify(b)}`)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}).map(b => b.toJSON())
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
|
Reference in New Issue
Block a user