mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-07 04:19:41 +00:00
Update User.toJSONForPublic to remove mostRecent key and session key only includes the PlaybackSession
This commit is contained in:
parent
09c9c28028
commit
f465193b9c
4 changed files with 26 additions and 60 deletions
|
|
@ -78,6 +78,11 @@ class PlaybackSession {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Session data to send to clients
|
||||
* @param {[oldLibraryItem]} libraryItem optional
|
||||
* @returns {object}
|
||||
*/
|
||||
toJSONForClient(libraryItem) {
|
||||
return {
|
||||
id: this.id,
|
||||
|
|
@ -105,8 +110,8 @@ class PlaybackSession {
|
|||
startedAt: this.startedAt,
|
||||
updatedAt: this.updatedAt,
|
||||
audioTracks: this.audioTracks.map(at => at.toJSON()),
|
||||
videoTrack: this.videoTrack ? this.videoTrack.toJSON() : null,
|
||||
libraryItem: libraryItem.toJSONExpanded()
|
||||
videoTrack: this.videoTrack?.toJSON() || null,
|
||||
libraryItem: libraryItem?.toJSONExpanded() || null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue