forked from 0x2620/pandora
remove cached frames
This commit is contained in:
parent
e89c0e30b2
commit
fa05c9d297
3 changed files with 14 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ from __future__ import division, with_statement
|
|||
import os.path
|
||||
import re
|
||||
import time
|
||||
import shutil
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
|
|
@ -276,6 +277,11 @@ class File(models.Model):
|
|||
return instance.path
|
||||
return self.path
|
||||
|
||||
def delete_frames(self):
|
||||
frames = os.path.join(settings.MEDIA_ROOT, self.get_path('frames'))
|
||||
if os.path.exists(frames):
|
||||
shutil.rmtree(frames)
|
||||
|
||||
def delete_file(sender, **kwargs):
|
||||
f = kwargs['instance']
|
||||
#FIXME: delete streams here
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue