(self, user, subscribed_podcasts, since, max_per_podcast=5)
Returns the episode updates since the timestamp
Returns the episode updates since the timestamp
Returns the episode updates since the timestamp
def get_episode_updates(self, user, subscribed_podcasts, since, max_per_podcast=5):
        """Returns the episode updates since the timestamp"""

        episodes = []
        for podcast in subscribed_podcasts:
            eps = Episode.objects.filter(podcast=podcast, released__gt=since).order_by(
                "-order", "-released"
            )
            episodes.extend(eps[:max_per_podcast])

        states = EpisodeState.dict_for_user(user, episodes)

        for episode in episodes:
            yield EpisodeStatus(episode, states.get(episode.id, "new"), None)
def get_episode_updates ( self , user , subscribed_podcasts , since , max_per_podcast = 5 ) : episodes = [ ] for podcast in subscribed_podcasts : eps = Episode . objects . filter ( podcast = podcast , released__gt = since ) . order_by ( "-order" , "-released" ) episodes . extend ( eps [ : max_per_podcast ] ) states = EpisodeState . dict_for_user ( user , episodes ) for episode in episodes : yield EpisodeStatus ( episode , states . get ( episode . id , "new" ) , None )