From 21a6007f8cbce6d559a61f9764cae02da0c30f10 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 22 Oct 2015 19:40:20 +0200 Subject: [PATCH] only add video sitemap for films that can be played --- pandora/item/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora/item/tasks.py b/pandora/item/tasks.py index a019a4e16..f45a622be 100644 --- a/pandora/item/tasks.py +++ b/pandora/item/tasks.py @@ -127,6 +127,7 @@ def update_sitemap(base_url): priority.text = '1.0' allowed_level = settings.CONFIG['capabilities']['canSeeItem']['guest'] + can_play = settings.CONFIG['capabilities']['canPlayVideo']['guest'] for i in models.Item.objects.filter(level__lte=allowed_level): url = ET.SubElement(urlset, "url") # URL of the page. This URL must begin with the protocol (such as http) @@ -141,7 +142,7 @@ def update_sitemap(base_url): # priority of page on site values 0.1 - 1.0 priority = ET.SubElement(url, "priority") priority.text = '1.0' - if i.rendered: + if i.rendered and i.level <= can_play: video = ET.SubElement(url, "video:video") #el = ET.SubElement(video, "video:content_loc") #el.text = absolute_url("%s/video" % i.public_id)