mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-05-24 01:13:00 -04:00
Added mediaMetadata to playbackSessions
This commit is contained in:
parent
3b4a5b8785
commit
33e0987d73
@ -175,6 +175,12 @@ class PlaybackSessionManager {
|
|||||||
// New session from local
|
// New session from local
|
||||||
session = new PlaybackSession(sessionJson)
|
session = new PlaybackSession(sessionJson)
|
||||||
session.deviceInfo = deviceInfo
|
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)
|
session.setDuration(libraryItem, sessionJson.episodeId)
|
||||||
Logger.debug(`[PlaybackSessionManager] Inserting new session for "${session.displayTitle}" (${session.id})`)
|
Logger.debug(`[PlaybackSessionManager] Inserting new session for "${session.displayTitle}" (${session.id})`)
|
||||||
await Database.createPlaybackSession(session)
|
await Database.createPlaybackSession(session)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user