include oshash in video url to avoid cache issues

This commit is contained in:
j 2016-08-13 15:35:20 +02:00
commit 3d6d1be2e6
7 changed files with 21 additions and 14 deletions

View file

@ -126,10 +126,13 @@ class MetaClip(object):
j['cuts'] = tuple([c for c in self.item.get('cuts', []) if c > self.start and c < self.end])
for key in keys:
if key not in self.clip_keys and key not in j:
value = self.item.get(key) or self.item.json.get(key)
if key == 'streams':
value = [s.file.oshash for s in self.item.streams()]
else:
value = self.item.get(key) or self.item.json.get(key)
if not value and hasattr(self.item.sort, key):
value = getattr(self.item.sort, key)
if value != None:
if value is not None:
j[key] = value
return j
@ -152,6 +155,7 @@ class MetaClip(object):
data['duration'] = data['out'] - data['in']
data['cuts'] = tuple([c for c in self.item.get('cuts', []) if c > self.start and c < self.end])
data['layers'] = self.get_layers(user)
data['streams'] = [s.file.oshash for s in self.item.streams()]
return data
def get_layers(self, user=None):

View file

@ -149,7 +149,7 @@ def findClips(request, data):
if 'annotations' in keys:
aqs = Annotation.objects.filter(layer__in=settings.CONFIG['clipLayers'],
clip__in=clips)
add_annotations('annotations', aqs , True)
add_annotations('annotations', aqs, True)
for layer in filter(lambda l: l in keys, layer_ids):
aqs = Annotation.objects.filter(layer=layer, clip__in=clips)

View file

@ -472,6 +472,8 @@ def get(request, data):
info = item.get_json(data['keys'])
if not data['keys'] or 'stream' in data['keys']:
info['stream'] = item.get_stream()
if not data['keys'] or 'streams' in data['keys']:
info['streams'] = [s.file.oshash for s in item.streams()]
if data['keys'] and 'layers' in data['keys']:
info['layers'] = item.get_layers(request.user)
if data['keys'] and 'documents' in data['keys']: