mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-11-08 00:54:33 +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
|
// Podcast categories
|
||||||
const podcastEpisodes = libraryItem.media.episodes || []
|
const podcastEpisodes = libraryItem.media.episodes || []
|
||||||
for (const episode of podcastEpisodes) {
|
for (const episode of podcastEpisodes) {
|
||||||
|
const mediaProgress = allItemProgress.find(mp => mp.episodeId === episode.id)
|
||||||
|
|
||||||
// Newest episodes
|
// Newest episodes
|
||||||
if (episode.addedAt > categoryMap['episodes-recently-added'].smallest) {
|
if (!mediaProgress?.isFinished && episode.addedAt > categoryMap['episodes-recently-added'].smallest) {
|
||||||
const libraryItemWithEpisode = {
|
const libraryItemWithEpisode = {
|
||||||
...libraryItem.toJSONMinified(),
|
...libraryItem.toJSONMinified(),
|
||||||
recentEpisode: episode.toJSON()
|
recentEpisode: episode.toJSON()
|
||||||
@ -483,7 +485,6 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Episode recently listened and finished
|
// Episode recently listened and finished
|
||||||
const mediaProgress = allItemProgress.find(mp => mp.episodeId === episode.id)
|
|
||||||
if (mediaProgress) {
|
if (mediaProgress) {
|
||||||
if (mediaProgress.isFinished) {
|
if (mediaProgress.isFinished) {
|
||||||
if (mediaProgress.finishedAt > categoryMap['listen-again'].smallest) { // Item belongs on shelf
|
if (mediaProgress.finishedAt > categoryMap['listen-again'].smallest) { // Item belongs on shelf
|
||||||
|
Loading…
Reference in New Issue
Block a user