[Flattr] fix bug when flattring episode
[mygpo.git] / mygpo / core / podcasts.py
blobcb75014d4ae14c52d2c4f8b603ecbfd7cd2c20a1
1 from mygpo.podcasts.models import Podcast, PodcastGroup
4 # the default sort order for podcasts
5 PODCAST_SORT=lambda p: p.display_title
8 def lazy_call(f, *args, **kwargs):
9 for x in f(*args, **kwargs):
10 yield x
13 def individual_podcasts(pg):
14 """ returns individual podcasts for an iter of Podcast(Group) objects """
16 for p in pg:
17 if isinstance(p, Podcast):
18 yield p
20 elif isinstance(p, PodcastGroup):
21 for x in p.podcast_set.all():
22 yield x