only add video sitemap for films that can be played

This commit is contained in:
j 2015-10-22 19:40:20 +02:00
parent 08496a228e
commit 21a6007f8c

View file

@ -127,6 +127,7 @@ def update_sitemap(base_url):
priority.text = '1.0' priority.text = '1.0'
allowed_level = settings.CONFIG['capabilities']['canSeeItem']['guest'] 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): for i in models.Item.objects.filter(level__lte=allowed_level):
url = ET.SubElement(urlset, "url") url = ET.SubElement(urlset, "url")
# URL of the page. This URL must begin with the protocol (such as http) # 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 of page on site values 0.1 - 1.0
priority = ET.SubElement(url, "priority") priority = ET.SubElement(url, "priority")
priority.text = '1.0' priority.text = '1.0'
if i.rendered: if i.rendered and i.level <= can_play:
video = ET.SubElement(url, "video:video") video = ET.SubElement(url, "video:video")
#el = ET.SubElement(video, "video:content_loc") #el = ET.SubElement(video, "video:content_loc")
#el.text = absolute_url("%s/video" % i.public_id) #el.text = absolute_url("%s/video" % i.public_id)