mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-24 19:45:25 +02:00
Add: Experimental bookmarks edit and delete #115
This commit is contained in:
parent
fffa02e7e8
commit
9f66054a72
10 changed files with 234 additions and 39 deletions
|
@ -107,11 +107,26 @@ class AudiobookProgress {
|
|||
return hasUpdates
|
||||
}
|
||||
|
||||
checkBookmarkExists(time) {
|
||||
return this.bookmarks.find(bm => bm.time === time)
|
||||
}
|
||||
|
||||
createBookmark(time, title) {
|
||||
var newBookmark = new AudioBookmark()
|
||||
newBookmark.setData(time, title)
|
||||
this.bookmarks.push(newBookmark)
|
||||
return newBookmark
|
||||
}
|
||||
|
||||
updateBookmark(time, title) {
|
||||
var bookmark = this.bookmarks.find(bm => bm.time === time)
|
||||
if (!bookmark) return false
|
||||
bookmark.title = title
|
||||
return bookmark
|
||||
}
|
||||
|
||||
deleteBookmark(time) {
|
||||
this.bookmarks = this.bookmarks.filter(bm => bm.time !== time)
|
||||
}
|
||||
}
|
||||
module.exports = AudiobookProgress
|
Loading…
Add table
Add a link
Reference in a new issue