mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-11-07 16:44:16 +01:00
Update:Remove episodes from newest shelf when finished #1871
This commit is contained in:
parent
d0bce2949e
commit
18cb394884
@ -460,8 +460,10 @@ module.exports = {
|
||||
// Podcast categories
|
||||
const podcastEpisodes = libraryItem.media.episodes || []
|
||||
for (const episode of podcastEpisodes) {
|
||||
const mediaProgress = allItemProgress.find(mp => mp.episodeId === episode.id)
|
||||
|
||||
// Newest episodes
|
||||
if (episode.addedAt > categoryMap['episodes-recently-added'].smallest) {
|
||||
if (!mediaProgress?.isFinished && episode.addedAt > categoryMap['episodes-recently-added'].smallest) {
|
||||
const libraryItemWithEpisode = {
|
||||
...libraryItem.toJSONMinified(),
|
||||
recentEpisode: episode.toJSON()
|
||||
@ -483,7 +485,6 @@ module.exports = {
|
||||
}
|
||||
|
||||
// Episode recently listened and finished
|
||||
const mediaProgress = allItemProgress.find(mp => mp.episodeId === episode.id)
|
||||
if (mediaProgress) {
|
||||
if (mediaProgress.isFinished) {
|
||||
if (mediaProgress.finishedAt > categoryMap['listen-again'].smallest) { // Item belongs on shelf
|
||||
|
Loading…
Reference in New Issue
Block a user