mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-05-04 01:17:19 +02:00
Added mediaMetadata to playbackSessions
This commit is contained in:
parent
3b4a5b8785
commit
33e0987d73
@ -175,6 +175,12 @@ class PlaybackSessionManager {
|
||||
// New session from local
|
||||
session = new PlaybackSession(sessionJson)
|
||||
session.deviceInfo = deviceInfo
|
||||
// This makes sure that the client's metadata is preferred over the library's metadata, if available, to make a non-breaking change
|
||||
if(session.mediaMetadata == null) {
|
||||
// Only sync important metadata
|
||||
const { title, subtitle, narrators, authors, series, genres } = libraryItem.media.metadata || {};
|
||||
session.mediaMetadata = { title, subtitle, narrators, authors, series, genres };
|
||||
}
|
||||
session.setDuration(libraryItem, sessionJson.episodeId)
|
||||
Logger.debug(`[PlaybackSessionManager] Inserting new session for "${session.displayTitle}" (${session.id})`)
|
||||
await Database.createPlaybackSession(session)
|
||||
|
Loading…
Reference in New Issue
Block a user