mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-31 08:14:40 +02:00
This commit is contained in:
parent
f9bf846b30
commit
c5eafdfa8a
9 changed files with 284 additions and 21 deletions
32
server/objects/AudioBookmark.js
Normal file
32
server/objects/AudioBookmark.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
class AudioBookmark {
|
||||
constructor(bookmark) {
|
||||
this.title = null
|
||||
this.time = null
|
||||
this.createdAt = null
|
||||
|
||||
if (bookmark) {
|
||||
this.construct(bookmark)
|
||||
}
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
title: this.title || '',
|
||||
time: this.time,
|
||||
createdAt: this.createdAt
|
||||
}
|
||||
}
|
||||
|
||||
construct(bookmark) {
|
||||
this.title = bookmark.title || ''
|
||||
this.time = bookmark.time || 0
|
||||
this.createdAt = bookmark.createdAt
|
||||
}
|
||||
|
||||
setData(time, title) {
|
||||
this.title = title
|
||||
this.time = time
|
||||
this.createdAt = Date.now()
|
||||
}
|
||||
}
|
||||
module.exports = AudioBookmark
|
Loading…
Add table
Add a link
Reference in a new issue