remove cached frames

This commit is contained in:
j 2012-01-07 16:18:05 +05:30
commit fa05c9d297
3 changed files with 14 additions and 1 deletions

View file

@ -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