mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-21 11:24:53 +02:00
Fixes for db migration & local playback sessions
This commit is contained in:
parent
63e5cf2e60
commit
d99b2c25e8
13 changed files with 750 additions and 119 deletions
|
@ -115,13 +115,24 @@ class PlaybackSession {
|
|||
this.userId = session.userId
|
||||
this.libraryId = session.libraryId || null
|
||||
this.libraryItemId = session.libraryItemId
|
||||
this.bookId = session.bookId
|
||||
this.bookId = session.bookId || null
|
||||
this.episodeId = session.episodeId
|
||||
this.mediaType = session.mediaType
|
||||
this.duration = session.duration
|
||||
this.playMethod = session.playMethod
|
||||
this.mediaPlayer = session.mediaPlayer || null
|
||||
|
||||
// Temp do not store old IDs
|
||||
if (this.libraryId?.startsWith('lib_')) {
|
||||
this.libraryId = null
|
||||
}
|
||||
if (this.libraryItemId?.startsWith('li_') || this.libraryItemId?.startsWith('local_')) {
|
||||
this.libraryItemId = null
|
||||
}
|
||||
if (this.episodeId?.startsWith('ep_') || this.episodeId?.startsWith('local_')) {
|
||||
this.episodeId = null
|
||||
}
|
||||
|
||||
if (session.deviceInfo instanceof DeviceInfo) {
|
||||
this.deviceInfo = new DeviceInfo(session.deviceInfo.toJSON())
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue