From 34be7923a781307ab20e19707e5fddd44d7f8e98 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 7 Mar 2013 10:24:25 +0000 Subject: [PATCH] use frame as thumbnail, fix default frame. --- pandora/item/tasks.py | 5 ++--- pandora/item/views.py | 17 +++++++++-------- pandora/templates/item.html | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pandora/item/tasks.py b/pandora/item/tasks.py index bd4ad070..b60f16a6 100644 --- a/pandora/item/tasks.py +++ b/pandora/item/tasks.py @@ -145,12 +145,11 @@ def update_sitemap(base_url): #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/video" % i.itemId) + 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") - icon = settings.CONFIG['user']['ui']['icons'] == 'frames' and 'icon' or 'poster' - el.text = absolute_url("%s/%s256.jpg" %(i.itemId, icon)) + el.text = absolute_url("%s/%96p.jpg" % i.itemId) description = i.get('description', i.get('summary', '')) if description: el = ET.SubElement(video, "video:description") diff --git a/pandora/item/views.py b/pandora/item/views.py index 859089e9..9f333540 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -700,14 +700,15 @@ def frame(request, id, size, position=None): return HttpResponseForbidden() frame = None if not position: - frames = item.poster_frames() - if frames: - position = item.poster_frame - if position == -1 or position > len(frames): - position = int(len(frames)/2) - position = frames[int(position)]['position'] - elif item.poster_frame == -1 and item.sort.duration: - position = item.sort.duration/2 + if settings.CONFIG['media']['importFrames'] or item.poster_frame == -1: + frames = item.poster_frames() + if frames: + position = item.poster_frame + if position == -1 or position > len(frames): + position = int(len(frames)/2) + position = frames[int(position)]['position'] + elif item.poster_frame == -1 and item.sort.duration: + position = item.sort.duration/2 else: position = item.poster_frame else: diff --git a/pandora/templates/item.html b/pandora/templates/item.html index 90a8b9d6..06be5fec 100644 --- a/pandora/templates/item.html +++ b/pandora/templates/item.html @@ -16,12 +16,12 @@ - - + + - +