Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added live episodes to the front page #197

Closed
wants to merge 2 commits into from

Conversation

ericpp
Copy link
Contributor

@ericpp ericpp commented Nov 4, 2022

Shows live episodes posted within the past hour on the front page of the website. Live episodes appear before recent episodes in the carousel and the user can switch between them by clicking on the normal left/right buttons.

image

This code makes the assumption that live episodes posted within the past hour are currently live. The API doesn't currently provide the live status or start and end times of live episodes.

@ericpp
Copy link
Contributor Author

ericpp commented Nov 4, 2022

Hrm. The logic on this might be too flaky to use. The PC2.0 stream didn't appear in /api/episodes/live until after the show was over and the feed was updated at 2:30pm.

@daveajones
Copy link
Contributor

What do you need to make it work better? More metadata about the stream from the API?

@ericpp
Copy link
Contributor Author

ericpp commented Nov 10, 2022

@daveajones Adding the live status (pending, live, ended) and/or start/end dates to the /episodes/live endpoint would help to know which episodes in the feed are currently live.

Alternatively, you could add a status parameter to the endpoint, e.g. /episodes/live?status=live, to filter out anything that isn't currently live. This would also let me find long-running live podcasts like the 100% Retro show, which currently doesn't show up in the feed.

Also, what conditions cause datePublished or dateCrawled to be updated in the /episodes/live endpoint? The feed seems to be reverse-chronologically ordered by one of those items and I'm wondering why last week's PC2.0 didn't show up in the feed until after it ended. Does any change to the liveItem tag cause those timestamps to be updated or is it only for specific changes?

@ericpp
Copy link
Contributor Author

ericpp commented Nov 10, 2022

No Agenda isn't showing up in the live feed today:
live-20221110133025.txt
noagenda-20221110133025.txt

EDIT: Now it's showing up as of 1:36pm today:

live-20221110133658.txt
noagenda-20221110133658.txt

@SpencerPearson
Copy link
Contributor

I love this idea! Have you been having better luck with it lately @ericpp ? Would be happy to help test it, we go live tonight around 9 central US

@ericpp
Copy link
Contributor Author

ericpp commented Jan 4, 2023

Hey Sir @SpencerPearson! Unfortunately no, I'm still hitting two issues with the Podcast Index API:

  • Live podcasts take awhile to show up in the live feed of the API (roughly 10-30 minutes). (Bowl After Bowl went live around 9:32PM but didn't hit the API until 9:42PM)
  • The API doesn't surface the liveItem status or the end timestamp to know when a live podcast has ended. As a result, the site will show LIVE PODCASTS for podcasts that have long since ended.

My current code works around the second issue by removing podcasts after an hour of being posted. The first issue would still cause confusion for podcasters who would expect their podcast to show up after going live.

@daveajones
Copy link
Contributor

I'm working on solving this issue by including liveItem's in the normal /episodes/by____ response. Will update this when ready.

@ericpp
Copy link
Contributor Author

ericpp commented Jan 9, 2023

@daveajones Excellent! That would let me show live shows on the podcast page as well.

@ericpp ericpp force-pushed the live-episodes branch 2 times, most recently from 0a99fc9 to b613aeb Compare March 10, 2023 04:46
@ericpp ericpp marked this pull request as draft March 23, 2023 04:48
@ericpp
Copy link
Contributor Author

ericpp commented Mar 23, 2023

The code now checks the /episodes/live endpoint to gather all recently updated live items and then uses the /episodes/byfeedid endpoint to check which of those updated live items correspond to currently live podcasts. This approach seems to work, but can be slow (1-5s) depending on how many feeds it needs to check.

Also, the /episodes/live endpoint seems to return updated live items in descending order of id. Some podcasts seem to retain the same live item ids while others have new ids issued. This causes podcasts that retain ids to appear at the bottom of the list or to not appear at all. See: Podcastindex-org/docs-api#96

@daveajones
Copy link
Contributor

@ericpp Ok to close this or are you still working on it?

@ericpp
Copy link
Contributor Author

ericpp commented Aug 29, 2024

@daveajones I'm not comfortable deploying it in the current state. It needs a specific API call that returns live episodes based on most recent timestamp rather than id.

@ericpp ericpp closed this Aug 29, 2024
@daveajones
Copy link
Contributor

10-4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants