forked from 0x2620/pandora
cleanup poster cache
This commit is contained in:
parent
893f2e5423
commit
5c90ff79a0
1 changed files with 8 additions and 8 deletions
|
@ -1403,14 +1403,14 @@ class Item(models.Model):
|
||||||
data = f.read()
|
data = f.read()
|
||||||
if data:
|
if data:
|
||||||
self.save_poster(data)
|
self.save_poster(data)
|
||||||
poster = self.path('poster.jpg')
|
poster = self.path('poster.jpg')
|
||||||
poster = os.path.abspath(os.path.join(settings.MEDIA_ROOT, poster))
|
poster = os.path.abspath(os.path.join(settings.MEDIA_ROOT, poster))
|
||||||
for f in glob(poster.replace('.jpg', '*.jpg')):
|
for f in glob(poster.replace('.jpg', '*.jpg')):
|
||||||
if f != poster:
|
if f != poster:
|
||||||
try:
|
try:
|
||||||
os.unlink(f)
|
os.unlink(f)
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_siteposter(self):
|
def make_siteposter(self):
|
||||||
poster = self.path('siteposter.jpg')
|
poster = self.path('siteposter.jpg')
|
||||||
|
|
Loading…
Reference in a new issue