avoid creating Clip multiple times

This commit is contained in:
j 2013-03-24 12:25:09 +00:00
parent 1cd7c52ab6
commit 488b5431de

View file

@ -92,7 +92,7 @@ class MetaClip:
end = float('%0.03f' % end)
qs = cls.objects.filter(item=item, start=start, end=end)
if qs.count() == 0:
clip = Clip(item=item, start=start, end=end)
clip, created = cls.objects.get_or_create(item=item, start=start, end=end)
clip.save()
created = True
else: