mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-09 23:27:34 +02:00
Update User.toJSONForPublic to remove mostRecent key and session key only includes the PlaybackSession
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user