mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-28 13:46:20 +02:00
Update Playlist.js to get only episodes in playlist
This commit is contained in:
parent
875e6cabe8
commit
f71b9b7407
@ -77,11 +77,12 @@ class Playlist extends Model {
|
||||
|
||||
const oldPlaylist = this.sequelize.models.playlist.getOldPlaylist(this)
|
||||
const libraryItemIds = oldPlaylist.items.map((i) => i.libraryItemId)
|
||||
const episodeIds = oldPlaylist.items.map((i) => i.episodeId).filter(id => id !== null)
|
||||
|
||||
let libraryItems = await this.sequelize.models.libraryItem.getAllOldLibraryItems({
|
||||
id: libraryItemIds
|
||||
id: libraryItemIds,
|
||||
episodeIds: episodeIds
|
||||
})
|
||||
|
||||
const playlistExpanded = oldPlaylist.toJSONExpanded(libraryItems)
|
||||
|
||||
if (include?.includes('rssfeed')) {
|
||||
@ -94,6 +95,7 @@ class Playlist extends Model {
|
||||
return playlistExpanded
|
||||
}
|
||||
|
||||
|
||||
static createFromOld(oldPlaylist) {
|
||||
const playlist = this.getFromOld(oldPlaylist)
|
||||
return this.create(playlist)
|
||||
|
Loading…
Reference in New Issue
Block a user