Commit graph

103 commits

Author SHA1 Message Date
j
e9863c238e always use get_operator, avoid case-insensitive match if possible 2016-06-30 11:28:09 +02:00
j
5b545e6e43 layer first 2016-06-30 02:42:24 +02:00
3f5be0bd27
findClips: look up entity names (fixes #2804) 2016-04-19 12:28:58 +01:00
d0129a4416
findClips: avoid O(n²) lookup of clip from annotation
This doesn't make much difference for small ranges, of course.
2016-04-19 11:25:12 +01:00
ba00bcbf7b
findClips: select_related('item') / ('item__sort')
Clip.public_id uses self.item.public_id.

Clip.json() uses self.item.sort, so we should select_related on that
rather than the clip's own sort field. (They are identical objects. Is
Clip.sort ever used directly?)

With this change, findClips() issues one query to fetch clips plus one
query per flavour of annotation; before, it issued two extra queries per
clip.
2016-04-19 11:25:06 +01:00
6dbb7f921a
findClips: only scan layers once 2016-04-19 11:14:25 +01:00
j
051a3578b4 inline django 1.9 version of ox.django 2016-02-20 10:41:23 +00:00
j
3f02f6086a fix clip random 2016-02-20 15:15:01 +05:30
j
4219246909 db migration 2016-02-20 15:15:01 +05:30
j
158c68fbc7 use object class for MetaClip 2016-02-20 05:58:53 +00:00
j
1cc795995d user.get_profile()->user.profile 2016-02-19 22:06:11 +05:30
j
e738503380 remove old migrations 2016-02-19 15:17:18 +00:00
j
6f4c010be0 only return layers defined in config 2015-10-04 14:11:39 +01:00
j
5649892bbd annotation layer flag is boolean 2015-10-04 11:20:45 +02:00
9265b8a53b Clip.save: fetch annotations once, not ~ 2 * n_layers
With 17 layers and 12 clipLayers, this repeated fetching was around 49%
of the cost of this function, which was in turn 94% of the cost of
creating many new annotations with mostly-unique endpoints. This helps a
bit...

If the order of clipLayers is not meant to be significant to sortvalue
(which I assume it is) then this could be simpler.
2015-10-04 11:17:22 +02:00
eaa07b1ccb ClipManager: match annotation layer case-sensitively (fixes #2832)
The case must be correct anyway for the layer to be found in
settings.CONFIG['layers']. Running this:

    Q(annotation__layer__iexact='foo') &
    Q(annotation__findvalue__icontains='bar')

compiles to

    upper(layer) = upper('foo') and
    ...

which can't use the case-sensitive annotation_annotation_layer index.
This:

    Q(annotation__layer__exact='foo') &
    Q(annotation__findvalue__icontains='bar')

can. (It still can't use the findvalue_like index, though! The other
option is to add indices on upper(layer) and upper(findvalue)
[varchar_pattern_ops].)
2015-09-14 14:13:06 +02:00
da1ad5b9c1 ClipManager.filter_annotations: fix 'opterator' typo (fixes #2832) 2015-09-14 14:11:40 +02:00
8759b569da Cache serialized entities when fetching many annotations
For a scene with ~5600 annotations, of which ~3100 are entities, this
cuts fetching the scene from 12 seconds to 2 seconds.
2015-09-14 14:08:02 +02:00
eebb0b5681 Combine {Item,Clip,edit.Clip}.get_layers()
This has several benefits:

    • Clip.get_layers() (used by smart edits) and Item.get_layers() pick up
    the select_related('user') optimization added for static edits in
    r5007.

    • Static edits and items pick up the optimization from r4941 to select
    annotations once, not once per layer.

Fetching an item with ~1000 annotations took ~1s without this patch,
~0.34s with this patch. Another item with ~6000 annotations took ~11.6s
before, ~8.6s after.

Because this block is moved out to the top:

if user and user.is_anonymous():
user = None

then, for anonymous users,

"editable": false,

is no longer included in the annotations. The old behaviour ended up
including this key in all layers listed before the first private layer
in the config, and leaving it out from later ones. So this new behaviour
is more consistent.
2015-09-14 14:06:43 +02:00
j
abf445b7f1 faster edits 2015-04-25 19:02:34 +02:00
j
083fabc208 include first annotation as annotation id for clips 2015-04-02 13:43:46 +02:00
rolux
cada20f904 update api docs 2014-12-19 15:05:08 +00:00
j
9e9bf30c42 add new changelog and call add_changelog all over the place 2014-12-17 13:45:46 +00:00
j
b8b91592b5 always include empty annotations 2014-11-21 16:24:49 +00:00
j
86ab36c6a6 dont fail without cuts 2014-11-18 14:54:41 +00:00
j
16f1dbca93 fix findClips for layers no in clipLayers 2014-11-17 14:12:29 +00:00
j
ceb507020b data is passed to api functions now 2014-10-06 08:26:43 +00:00
j
3232ce6989 rename Item.itemId to Item.public_id 2014-09-19 12:26:46 +00:00
j
e381609b9e remove tests, not used 2014-09-05 13:39:43 +02:00
j
b2b2649420 make smart edits return clips inline 2014-02-05 13:21:17 +00:00
j
2a708e72cf fix html in atom feed titles 2014-01-25 09:00:52 +00:00
j
056fdb706f dont add None, null clip results, fixes #1425 2013-07-10 14:29:23 +00:00
j
9cd9611306 use new Ox.VideoElement, add inital player to edits and view as video results view 2013-07-09 22:49:01 +00:00
j
ce16c93fb4 dont create db_index in south 2013-07-03 10:51:59 +00:00
j
4d9635ab70 dont enable fulltext index by default, only used with GIN enabled 2013-06-06 07:35:52 +00:00
j
488b5431de avoid creating Clip multiple times 2013-03-24 12:25:09 +00:00
j
70cfee4f73 dont fail if no subtitles layer is defined 2013-03-14 07:32:59 +00:00
j
e706fbfb9b api documentation takes and returns 2013-03-04 19:35:06 +00:00
j
661e005b78 dont expose ids of empty subtitles, fixes #1333 2013-03-02 08:57:39 +00:00
j
066d7c8588 find clip queries too 2012-11-18 20:41:18 +01:00
j
73cbde63cf clips too 2012-11-18 20:34:43 +01:00
j
2c07dedac0 add south migrations, convert update to python 2012-11-02 13:41:41 +01:00
j
22e7dc7421 dont fail for clips < 0 2012-10-09 19:22:16 +02:00
j
6fd5adbb1d dont fail for clips < 1 frame 2012-10-09 19:10:46 +02:00
j
8b082023e9 add some more docs for findClips 2012-06-26 13:59:27 +02:00
j
81cef44d19 dont save clip/sequence ids in db 2012-06-18 16:36:04 +02:00
j
480d6c8cf2 use 0 padded 3 digit floats in qids for clips 2012-06-16 11:26:37 +02:00
j
9da8c75f70 dont fail if clipLayers is missing 2012-04-02 17:33:09 +02:00
j
0042546d6c print local name and ip in vm terminal, document trigram index 2012-03-30 16:57:07 +02:00
j
577afd682e only add index flag if DB_GIN_TRGM is set 2012-03-27 13:26:51 +02:00