From 9d6a29a4f41567eea394c53e0067cba30b6817e1 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 17 Jan 2014 17:59:45 +0000 Subject: [PATCH] only include video metadata for rendered items (sitemap.xml) --- pandora/item/tasks.py | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/pandora/item/tasks.py b/pandora/item/tasks.py index b8e8d32bd..10a6e2acf 100644 --- a/pandora/item/tasks.py +++ b/pandora/item/tasks.py @@ -141,26 +141,27 @@ def update_sitemap(base_url): # priority of page on site values 0.1 - 1.0 priority = ET.SubElement(url, "priority") priority.text = '1.0' - video = ET.SubElement(url, "video:video") - #el = ET.SubElement(video, "video:content_loc") - #el.text = absolute_url("%s/video" % i.itemId) - el = ET.SubElement(video, "video:player_loc") - el.attrib['allow_embed'] = 'no' - el.text = absolute_url("%s/player" % i.itemId) - el = ET.SubElement(video, "video:title") - el.text = i.get('title') - el = ET.SubElement(video, "video:thumbnail_loc") - el.text = absolute_url("%s/96p.jpg" % i.itemId) - description = i.get_item_description() - if description: - el = ET.SubElement(video, "video:description") - el.text = description - el = ET.SubElement(video, "video:family_friendly") - el.text = 'Yes' - duration = i.sort.duration - if duration > 0: - el = ET.SubElement(video, "video:duration") - el.text = "%s" % int(duration) + if i.rendered: + video = ET.SubElement(url, "video:video") + #el = ET.SubElement(video, "video:content_loc") + #el.text = absolute_url("%s/video" % i.itemId) + el = ET.SubElement(video, "video:player_loc") + el.attrib['allow_embed'] = 'no' + el.text = absolute_url("%s/player" % i.itemId) + el = ET.SubElement(video, "video:title") + el.text = i.get('title') + el = ET.SubElement(video, "video:thumbnail_loc") + el.text = absolute_url("%s/96p.jpg" % i.itemId) + description = i.get_item_description() + if description: + el = ET.SubElement(video, "video:description") + el.text = description + el = ET.SubElement(video, "video:family_friendly") + el.text = 'Yes' + duration = i.sort.duration + if duration > 0: + el = ET.SubElement(video, "video:duration") + el.text = "%s" % int(duration) for t in Text.objects.filter(Q(status='featured')|Q(status='public')): url = ET.SubElement(urlset, "url")