setPoster

This commit is contained in:
j 2011-08-01 18:55:18 +02:00
commit 8026c64e41
5 changed files with 6 additions and 4 deletions

View file

@ -813,7 +813,7 @@ class Item(models.Model):
def make_poster(self, force=False):
posters = glob(os.path.abspath(os.path.join(settings.MEDIA_ROOT,
self.path('poster.*.jpg'))))
for f in filter(posters, lambda p: not p.endswith('poster.local.jpg')):
for f in filter(lambda p: not p.endswith('poster.local.jpg'), posters):
os.unlink(f)
if not self.poster or force:
url = self.prefered_poster_url()

View file

@ -479,7 +479,7 @@ def setPoster(request): #parse path and return info
if item.poster:
item.poster.delete()
item.save()
tasks.update_poster.delay(item.itemId)
tasks.update_poster(item.itemId)
response = json_response()
response['data']['poster'] = item.get_poster()
else: