mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-04 23:07:22 +02:00
Add:Podcasts latest episodes page
This commit is contained in:
@@ -226,6 +226,8 @@ class Server {
|
||||
'/library/:library/bookshelf/:id?',
|
||||
'/library/:library/authors',
|
||||
'/library/:library/series/:id?',
|
||||
'/library/:library/podcast/search',
|
||||
'/library/:library/podcast/latest',
|
||||
'/config/users/:id',
|
||||
'/config/users/:id/sessions',
|
||||
'/collection/:id'
|
||||
|
||||
@@ -517,6 +517,11 @@ class LibraryController {
|
||||
const unfinishedEpisodes = libraryItem.media.episodes.filter(ep => {
|
||||
const userProgress = req.user.getMediaProgress(libraryItem.id, ep.id)
|
||||
return !userProgress || !userProgress.isFinished
|
||||
}).map(_ep => {
|
||||
const ep = _ep.toJSONExpanded()
|
||||
ep.podcast = libraryItem.media.toJSONMinified()
|
||||
ep.libraryItemId = libraryItem.id
|
||||
return ep
|
||||
})
|
||||
allUnfinishedEpisodes.push(...unfinishedEpisodes)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user