Skip to content

Commit

Permalink
Merge pull request #708 from podverse/develop
Browse files Browse the repository at this point in the history
Release v4.15.13
  • Loading branch information
mitchdowney committed Nov 30, 2023
2 parents 606ca05 + 59d732d commit dfce5e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 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.15.12",
"version": "4.15.13",
"description": "Data API, database migration scripts, and backend services for all Podverse models.",
"contributors": [
"Mitch Downey"
Expand Down
6 changes: 4 additions & 2 deletions src/controllers/episode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ const getEpisode = async (id) => {
{ relations }
)

if (!episode || !episode.podcast.isPublic) {
const isEndedLivestream = episode?.liveItem?.status === 'ended'

if (!isEndedLivestream && (!episode || !episode.podcast.isPublic)) {
throw new createError.NotFound('Episode not found')
} else if (!episode.isPublic) {
} else if (!isEndedLivestream && episode && !episode.isPublic) {
// If a public version of the episode isn't available, check if a newer public version
// of the episode is available and return that.
// Otherwise, return the non-public version of the episode. Any episode that no longer appears
Expand Down

0 comments on commit dfce5e6

Please sign in to comment.