setPoster

This commit is contained in:
j 2011-08-01 18:55:18 +02:00
commit a80f1f9515
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()