<?xml version="1.0" encoding="utf-8"?>
<!--! This file is a part of MediaCore, Copyright 2009 Simple Station Inc.

	MediaCore is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	MediaCore is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"
     xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
     xmlns:py="http://genshi.edgewall.org/"
     xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<xhtml:meta py:strip="h.meta_robots_noindex(rss=True)" xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<title py:if="defined('title')" py:content="title" />
		<link py:content="h.url_for(controller='/media', qualified=True)" />
		<description py:if="defined('description')" py:content="description" />
		<atom:link href="${h.url_for(qualified=True)}" rel="self" type="application/rss+xml" />
		<py:for each="item in media" py:with="file=h.pick_any_media_file(item)">
		<item py:if="file is not None" py:with="link=h.url_for(controller='/media', action='view', slug=item.slug, qualified=True)">
			<title py:content="item.title" />
			<link py:content="link" />
			<guid py:content="link" />
			<pubDate py:content="item.publish_on.strftime('%a, %d %b %Y %H:%M:%S') + ' +0000'" />
			<description py:content="item.description_plain" />
			<media:thumbnail url="${h.thumb_url(item, 'l', qualified=True)}" />
			<media:content py:attrs="dict(url=h.best_link_uri(file.get_uris()), duration=item.duration)"  />
			<media:community>
				<media:statistics views="${item.views}" />
				<media:tags py:if="item.tags" py:content="', '.join(x.name for x in item.tags)" />
			</media:community>
			<py:for each="category in item.categories[:1]">
				<media:category py:content="category.name" />
			</py:for>
		</item>
		</py:for>
	</channel>
</rss>
