clear siteposter cache too
This commit is contained in:
parent
5488eaf223
commit
c19598c4d7
2 changed files with 5 additions and 3 deletions
|
@ -1412,7 +1412,9 @@ class Item(models.Model):
|
|||
self.clear_poster_cache(self.poster.path)
|
||||
self.poster.delete()
|
||||
|
||||
def clear_poster_cache(self, poster):
|
||||
def clear_poster_cache(self, poster=None):
|
||||
if poster is None:
|
||||
poster = self.poster.path
|
||||
for f in glob(poster.replace('.jpg', '*.jpg')):
|
||||
if f != poster:
|
||||
try:
|
||||
|
|
|
@ -673,8 +673,8 @@ def setPoster(request, data):
|
|||
valid_sources = [p['source'] for p in item.get_posters()]
|
||||
if data['source'] in valid_sources:
|
||||
item.poster_source = data['source']
|
||||
if item.poster:
|
||||
item.poster.delete()
|
||||
item.remove_poster()
|
||||
item.clear_poster_cache(item.path('siteposter.jpg'))
|
||||
item.save()
|
||||
tasks.update_poster(item.public_id)
|
||||
response = json_response()
|
||||
|
|
Loading…
Reference in a new issue