update json cache too

This commit is contained in:
j 2013-01-31 08:16:04 +00:00
parent c748527921
commit 31652fe3d8

View file

@ -712,11 +712,14 @@ def poster(request, id, size=None):
poster_path = os.path.join(settings.MEDIA_ROOT, item.path('poster.jpg')) poster_path = os.path.join(settings.MEDIA_ROOT, item.path('poster.jpg'))
if os.path.exists(poster_path): if os.path.exists(poster_path):
item.poster.name = item.path('poster.jpg') item.poster.name = item.path('poster.jpg')
item.poster_height = item.poster.height
item.poster_width = item.poster.width
models.Item.objects.filter(pk=item.id).update( models.Item.objects.filter(pk=item.id).update(
poster=item.poster.name, poster=item.poster.name,
poster_height=item.poster.height, poster_height=item.poster_height,
poster_width=item.poster.width, poster_width=item.poster_width,
icon=item.icon.name icon=item.icon.name,
json=item.get_json()
) )
if item.poster: if item.poster:
return image_to_response(item.poster, size) return image_to_response(item.poster, size)