<?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/>.
-->
<sitemap xmlns:py="http://genshi.edgewall.org/" py:strip="True">

<sitemapindex py:if="defined('pages')"
              xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap py:for="page in range(0, pages)">
		<loc py:content="h.url_for(controller='/sitemaps', action='google', page=page, qualified=True)" />
	</sitemap>
</sitemapindex>

<urlset py:if="defined('media')"
        xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
	<url py:for="link in links">
		<loc py:content="link" />
	</url>
	<py:for each="item in media" py:with="file=h.pick_any_media_file(item)">
	<url py:if="file is not None">
		<loc py:content="h.url_for(controller='/media', action='view', id=file.id, slug=item.slug, qualified=True)" />
		<video:video>
			<video:content_loc py:content="h.url_for(controller='/media', action='serve', id=file.id, container=file.container, slug=item.slug, qualified=True)" />
			<video:thumbnail_loc py:content="h.thumb_url(item, 'l', qualified=True)" />
			<video:title py:content="item.title" />
			<video:description py:content="item.description_plain" />
			<video:view_count py:content="item.views" />
			<video:publication_date py:content="item.publish_on.strftime('%Y-%m-%d')" />
			<video:expiration_date py:if="item.publish_until" py:content="item.publish_until.strftime('%Y-%m-%d')" />
			<py:for each="tag in item.tags[:32]">
				<video:tag py:content="tag.name" />
			</py:for>
			<py:for each="category in item.categories[:1]">
				<video:tag py:content="category.name" />
			</py:for>
			<video:duration py:content="item.duration" />
			<!--! # left out for now, maybe supported in the future ??
			<video:player_loc allow_embed="yes" autoplay="ap=1">http://www.example.com/videoplayer.swf?video=123</video:player_loc>
			<video:rating>4.2</video:rating>
			<video:family_friendly>yes</video:family_friendly>
			<video:restriction relationship="allow">IE GB US CA</video:restriction>
			-->
		</video:video>
	</url>
	</py:for>
</urlset>

</sitemap>
