mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-02-06 13:30:03 +01:00
Fix getAllLibraryItemsInProgress route
This commit is contained in:
parent
c89d77dd06
commit
a99257e758
@ -256,13 +256,13 @@ class MeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GET: api/me/items-in-progress
|
// GET: api/me/items-in-progress
|
||||||
async getAllLibraryItemsInProgress(req, res) {
|
getAllLibraryItemsInProgress(req, res) {
|
||||||
const limit = !isNaN(req.query.limit) ? Number(req.query.limit) || 25 : 25
|
const limit = !isNaN(req.query.limit) ? Number(req.query.limit) || 25 : 25
|
||||||
|
|
||||||
var itemsInProgress = []
|
let itemsInProgress = []
|
||||||
for (const mediaProgress of req.user.mediaProgress) {
|
for (const mediaProgress of req.user.mediaProgress) {
|
||||||
if (!mediaProgress.isFinished && (mediaProgress.progress > 0 || libraryItem.ebookProgress > 0)) {
|
if (!mediaProgress.isFinished && (mediaProgress.progress > 0 || mediaProgress.ebookProgress > 0)) {
|
||||||
const libraryItem = await this.db.getLibraryItem(mediaProgress.libraryItemId)
|
const libraryItem = this.db.getLibraryItem(mediaProgress.libraryItemId)
|
||||||
if (libraryItem) {
|
if (libraryItem) {
|
||||||
if (mediaProgress.episodeId && libraryItem.mediaType === 'podcast') {
|
if (mediaProgress.episodeId && libraryItem.mediaType === 'podcast') {
|
||||||
const episode = libraryItem.media.episodes.find(ep => ep.id === mediaProgress.episodeId)
|
const episode = libraryItem.media.episodes.find(ep => ep.id === mediaProgress.episodeId)
|
||||||
|
Loading…
Reference in New Issue
Block a user