only include video metadata for rendered items (sitemap.xml)

This commit is contained in:
j 2014-01-17 17:59:45 +00:00
parent dd8eef3ee5
commit 9d6a29a4f4

View file

@ -141,26 +141,27 @@ 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'
video = ET.SubElement(url, "video:video") if i.rendered:
#el = ET.SubElement(video, "video:content_loc") video = ET.SubElement(url, "video:video")
#el.text = absolute_url("%s/video" % i.itemId) #el = ET.SubElement(video, "video:content_loc")
el = ET.SubElement(video, "video:player_loc") #el.text = absolute_url("%s/video" % i.itemId)
el.attrib['allow_embed'] = 'no' el = ET.SubElement(video, "video:player_loc")
el.text = absolute_url("%s/player" % i.itemId) el.attrib['allow_embed'] = 'no'
el = ET.SubElement(video, "video:title") el.text = absolute_url("%s/player" % i.itemId)
el.text = i.get('title') el = ET.SubElement(video, "video:title")
el = ET.SubElement(video, "video:thumbnail_loc") el.text = i.get('title')
el.text = absolute_url("%s/96p.jpg" % i.itemId) el = ET.SubElement(video, "video:thumbnail_loc")
description = i.get_item_description() el.text = absolute_url("%s/96p.jpg" % i.itemId)
if description: description = i.get_item_description()
el = ET.SubElement(video, "video:description") if description:
el.text = description el = ET.SubElement(video, "video:description")
el = ET.SubElement(video, "video:family_friendly") el.text = description
el.text = 'Yes' el = ET.SubElement(video, "video:family_friendly")
duration = i.sort.duration el.text = 'Yes'
if duration > 0: duration = i.sort.duration
el = ET.SubElement(video, "video:duration") if duration > 0:
el.text = "%s" % int(duration) el = ET.SubElement(video, "video:duration")
el.text = "%s" % int(duration)
for t in Text.objects.filter(Q(status='featured')|Q(status='public')): for t in Text.objects.filter(Q(status='featured')|Q(status='public')):
url = ET.SubElement(urlset, "url") url = ET.SubElement(urlset, "url")