use frame as thumbnail, fix default frame.

This commit is contained in:
j 2013-03-07 10:24:25 +00:00
parent cce51fa4db
commit 34be7923a7
3 changed files with 14 additions and 14 deletions

View file

@ -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")

View file

@ -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:

View file

@ -16,12 +16,12 @@
<meta name="title" content="{{title}}" />
<meta name="description" content="{{description}}"/>
<meta name="keywords" content="{{keywords|safe}}"/>
<meta content="{{url}}/{{icon}}128.jpg" name="thumbnail"/>
<meta content="{{url}}/{{icon}}128.jpg" name="image_src"/>
<meta content="{{url}}/96p.jpg" name="thumbnail"/>
<meta content="{{url}}/96p.jpg" name="image_src"/>
<meta property="og:title" content="{{title}}"/>
<meta property="og:type" content="movie"/>
<meta property="og:url" content="{{url}}"/>
<meta property="og:image" content="{{url}}/{{icon}}128.jpg"/>
<meta property="og:image" content="{{url}}/96p.jpg"/>
<meta property="og:site_name" content="{{settings.SITENAME}}"/>
<meta property="og:description" content="{{description}}"/>
<meta name="google" value="notranslate"/>