diff --git a/pandora/clip/models.py b/pandora/clip/models.py index 76cc4588..64639bdd 100644 --- a/pandora/clip/models.py +++ b/pandora/clip/models.py @@ -117,8 +117,7 @@ class MetaClip(object): #annotations = self.annotations.filter(layer__in=settings.CONFIG['clipLayers']) annotations = self.annotations.all() if qs: - for q in qs: - annotations = annotations.filter(q) + annotations = annotations.filter(qs) entity_cache = {} j['annotations'] = [ a.json(keys=['value', 'id', 'layer'], entity_cache=entity_cache) for a in annotations diff --git a/static/js/exportAnnotationsDialog.js b/static/js/exportAnnotationsDialog.js index 4db7cf84..dbf74c34 100644 --- a/static/js/exportAnnotationsDialog.js +++ b/static/js/exportAnnotationsDialog.js @@ -105,17 +105,6 @@ pandora.ui.exportAnnotationsDialog = function(options) { updateLink(); } - function textBlob(data) { - data = Ox.encodeUTF8(data); - var byteNumbers = new Array(data.length); - for (var i = 0; i < data.length; i++) { - byteNumbers[i] = data.charCodeAt(i); - } - var byteArray = new Uint8Array(byteNumbers); - var blob = new Blob([byteArray], {type: 'text/plain; charset=utf-8'}); - return blob; - } - function updateLink() { var layer = $layerSelect.value(), format = $formatSelect.value(), @@ -132,11 +121,11 @@ pandora.ui.exportAnnotationsDialog = function(options) { text: text }; }), - blob = textBlob( + blob = new Blob([Ox.encodeUTF8( format == 'json' ? JSON.stringify(items, null, ' ') : Ox.formatSRT(items) - ), + )], {type: 'text/plain; charset=utf-8'}), url = window.URL.createObjectURL(blob); $link.attr({