2 """ Converts models to a JSON representation """
5 def podcast_to_json(podcast
):
6 """ Convert a podcast to JSON for indexing """
8 'title': podcast
.title
,
9 'subtitle': podcast
.subtitle
,
10 'description': podcast
.description
,
12 'language': podcast
.language
,
13 'last_update': podcast
.last_update
,
14 'created': podcast
.created
,
15 # modified is not indexed
16 'license': podcast
.license
, # maybe get a license name here?
17 'flattr_url': podcast
.flattr_url
,
18 'content_types': list(filter(None, podcast
.content_types
)),
19 'outdated': podcast
.outdated
,
20 'author': podcast
.author
,
21 'logo_url': podcast
.logo_url
,
22 # group, group_member_name ???
23 'subscribers': podcast
.subscribers
,
25 # common_episode_title
27 'latest_episode_timestamp': podcast
.latest_episode_timestamp
,
28 'episode_count': podcast
.episode_count
,
30 'twitter': podcast
.twitter
,
32 'slugs': [s
.slug
for s
in podcast
.slugs
.all()],
33 'urls': [u
.url
for u
in podcast
.urls
.all()],