actually set poster
This commit is contained in:
parent
4a02ce7775
commit
7d47ba13a5
3 changed files with 9 additions and 3 deletions
|
|
@ -811,6 +811,10 @@ class Item(models.Model):
|
|||
return None
|
||||
|
||||
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')):
|
||||
os.unlink(f)
|
||||
if not self.poster or force:
|
||||
url = self.prefered_poster_url()
|
||||
if url:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue