Skip to content

Commit

Permalink
Removed the overkill of the patch on the Media RSS, ATOM and Sitemap …
Browse files Browse the repository at this point in the history
…views. Also added loop for multiple enclosures and players in Sitemap template.

git-svn-id: http://django-podcast.googlecode.com/svn@54 7eeeb57b-9f54-0410-948d-eb906a2a6a24
  • Loading branch information
richardcornish committed Nov 20, 2008
1 parent 6f3406e commit 2d410bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions trunk/podcast/templates/podcast/episode_sitemap.html
Expand Up @@ -4,8 +4,8 @@
<url>
<loc>{{ episode.show.link }}</loc>
<video:video>
<video:content_loc>{{ enclosure_list.all.0.file.url }}</video:content_loc>
{% if enclosure_list.all.0 %}<video:player_loc allow_embed="{% if enclosure_list.all.0.embed %}Yes{% else %}No{% endif %}">{{ enclosure_list.all.0.player }}</video:player_loc>{% endif %}
{% if enclosure_list.all.0.file %}{% for enclosure in enclosure_list %}<video:content_loc>{{ enclosure_list.file.url }}</video:content_loc>{% endfor %}{% endif %}
{% if enclosure_list.all.0.player %}{% for enclosure in enclosure_list %}<video:player_loc allow_embed="{% if enclosure_list.all.0.embed %}Yes{% else %}No{% endif %}">{{ enclosure_list.all.0.player }}</video:player_loc>{% endif %}{% endfor %}
{% if episode.image %}<video:thumbnail_loc>{{ episode.image.url }}</video:thumbnail_loc>{% endif %}
<video:title>{{ episode.title }}</video:title>
<video:description>{% if episode.summary %}{{ episode.summary|striptags }}{% else %}{{ episode.description|striptags }}{% endif %}</video:description>
Expand Down
6 changes: 3 additions & 3 deletions trunk/podcast/views.py
Expand Up @@ -84,7 +84,7 @@ def show_list_feed(request, slug):
mimetype='application/rss+xml',
queryset=Episode.objects.filter(show__slug__exact=slug).order_by('-date')[0:21],
extra_context={
'enclosure_list': Enclosure.objects.filter(episode__show__slug__exact=slug).filter(episode__slug__exact=episode_slug).order_by('-episode__date')},
'enclosure_list': Enclosure.objects.filter(episode__show__slug__exact=slug).order_by('-episode__date')},
template_name='podcast/show_feed.html')


Expand All @@ -102,7 +102,7 @@ def show_list_media(request, slug):
mimetype='application/rss+xml',
queryset=Episode.objects.filter(show__slug__exact=slug).order_by('-date')[0:21],
extra_context={
'enclosure_list': Enclosure.objects.filter(episode__show__slug__exact=slug).filter(episode__slug__exact=episode_slug).order_by('-episode__date')},
'enclosure_list': Enclosure.objects.filter(episode__show__slug__exact=slug).order_by('-episode__date')},
template_name='podcast/show_feed_media.html')


Expand All @@ -120,5 +120,5 @@ def show_list_atom(request, slug):
mimetype='application/rss+xml',
queryset=Episode.objects.filter(show__slug__exact=slug).order_by('-date')[0:21],
extra_context={
'enclosure_list': Enclosure.objects.filter(episode__show__slug__exact=slug).filter(episode__slug__exact=episode_slug).order_by('-episode__date')},
'enclosure_list': Enclosure.objects.filter(episode__show__slug__exact=slug).order_by('-episode__date')},
template_name='podcast/show_feed_atom.html')

0 comments on commit 2d410bf

Please sign in to comment.