mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-02-06 00:16:02 +01:00
This commit is contained in:
parent
456bb87a00
commit
160c83df4a
@ -49,7 +49,6 @@ class LibraryItemController {
|
|||||||
item.episodesDownloading = [this.podcastManager.currentDownload.toJSONForClient()]
|
item.episodesDownloading = [this.podcastManager.currentDownload.toJSONForClient()]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return res.json(item)
|
return res.json(item)
|
||||||
}
|
}
|
||||||
res.json(req.libraryItem)
|
res.json(req.libraryItem)
|
||||||
|
@ -421,6 +421,10 @@ class LibraryItem extends Model {
|
|||||||
if (!libraryItemId) return null
|
if (!libraryItemId) return null
|
||||||
|
|
||||||
const libraryItem = await this.findByPk(libraryItemId)
|
const libraryItem = await this.findByPk(libraryItemId)
|
||||||
|
if (!libraryItem) {
|
||||||
|
Logger.error(`[LibraryItem] Library item not found with id "${libraryItemId}"`)
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
if (libraryItem.mediaType === 'podcast') {
|
if (libraryItem.mediaType === 'podcast') {
|
||||||
libraryItem.media = await libraryItem.getMedia({
|
libraryItem.media = await libraryItem.getMedia({
|
||||||
@ -453,7 +457,7 @@ class LibraryItem extends Model {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!libraryItem) return null
|
if (!libraryItem.media) return null
|
||||||
return this.getOldLibraryItem(libraryItem)
|
return this.getOldLibraryItem(libraryItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +152,12 @@ class PodcastEpisode extends Model {
|
|||||||
extraData: DataTypes.JSON
|
extraData: DataTypes.JSON
|
||||||
}, {
|
}, {
|
||||||
sequelize,
|
sequelize,
|
||||||
modelName: 'podcastEpisode'
|
modelName: 'podcastEpisode',
|
||||||
|
indexes: [
|
||||||
|
{
|
||||||
|
fields: ['createdAt']
|
||||||
|
}
|
||||||
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
const { podcast } = sequelize.models
|
const { podcast } = sequelize.models
|
||||||
|
Loading…
Reference in New Issue
Block a user