Skip to content

Commit

Permalink
Merge pull request #688 from podverse/develop
Browse files Browse the repository at this point in the history
Release v4.14.11
  • Loading branch information
mitchdowney authored Oct 28, 2023
2 parents 79b528f + 9a9f630 commit 92a9853
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "podverse-api",
"version": "4.14.10",
"version": "4.14.11",
"description": "Data API, database migration scripts, and backend services for all Podverse models.",
"contributors": [
"Mitch Downey"
Expand Down
12 changes: 4 additions & 8 deletions src/controllers/episode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,16 +562,12 @@ const retrieveLatestChapters = async (id) => {
})
const existingChapters = await qb.getRawMany()

// If existing chapter with current chapter's startTime does not exist,
// then set the existingChapter to isPublic = false.
const deadChapters = existingChapters.filter((x) => {
return newChapters.every((y) => y.startTime !== x.startTime)
})

for (const deadChapter of deadChapters) {
// Temporarily hide all existing chapters,
// then display the new valid ones at the end.
for (const existingChapter of existingChapters) {
await updateMediaRef(
{
...deadChapter,
...existingChapter,
isPublic: false
},
superUserId
Expand Down

0 comments on commit 92a9853

Please sign in to comment.