Commit graph

218 commits

Author SHA1 Message Date
j
04e1adf53e return annotation layer by default 2018-10-09 19:44:12 +02:00
j
f93ece1ab7 add db based translations
load translations from files
and adds option to translate
string layers (i.e. keywords)
2018-09-19 16:53:30 +02:00
j
1e5d7e99b3 merge comment 2018-09-18 11:05:58 +02:00
j
6296be870b use get_user_model 2018-07-29 21:12:56 +01:00
j
bd0732b8d5 rename item.json -> item.cache 2018-07-09 15:22:12 +02:00
j
ebd23c9e52 use add_arguments 2018-06-19 20:36:22 +02:00
j
dbf740e55e use .editorconfig 2018-06-19 08:33:26 +02:00
j
41d4e52f84 don't fail on removed layers 2017-07-26 13:33:08 +02:00
j
fb738c25cf self.id 2017-06-28 12:55:01 +02:00
j
ae3afc93c3 space 2017-06-09 09:25:43 +02:00
j
fbd94867fc fix documents 2017-06-01 17:00:36 +02:00
j
f0a4aba751 use python_2_unicode_compatible 2017-03-03 08:56:35 +01:00
j
67b2fd698b fix save place 2017-02-25 11:18:59 +01:00
j
12f3901c9a py3 filter->list(filter 2017-02-16 14:24:51 +01:00
j
b23ca9df74 store document references in db 2017-01-26 15:56:28 +00:00
j
844d1697bd remove unused annotation.tasks.update_matches 2016-09-06 00:19:36 +02:00
j
4d1711cb01 only update subtitles if needed 2016-09-06 00:13:40 +02:00
j
d53659c0c4 move annotation update_matches logic into models 2016-09-05 23:46:36 +02:00
j
1c580a2df7 async update of annotation matches, fixes deadlock in load_subtitles 2016-08-31 18:03:19 +02:00
j
1468ddbecb towards supporting python 2 and 3
- use absolute_imports
- make use of six.moves
- use exec instead of execfile
- use list(dict) instead if dict.keys()
2016-08-25 18:34:36 +02:00
j
337cafcf76 don't add base keys to Item.data 2016-08-08 15:54:52 +02:00
j
6f4a0ba90a support vtt subtitles 2016-07-01 21:13:13 +02:00
j
e9863c238e always use get_operator, avoid case-insensitive match if possible 2016-06-30 11:28:09 +02:00
j
b6e4d33a43 add Annotation.findvalue index (used by findClips) 2016-06-30 02:42:24 +02:00
05e6118a88
findAnnotations: include duration alongside result count
fixes #2921
2016-05-05 15:54:25 +01:00
2812834ce3
findAnnotations: don't lowercase ids (fixes #2916)
Without this fix, a condition like:

     {key: 'id', operator: '==', value: 'A/B'}

gets mapped to:

     public_id__exact=('A/B'.lower())

which is wrong.

I introduced this bug in b3df5b8. I didn't catch it because I was
mostly interested in the 'layer' key -- but layer names are
conventionally lowercase anyway so lowercasing them had no effect.
2016-04-29 11:03:45 +01:00
aa40a40595
Annotation.json: only include entity id & name
Fetching documents for each entity in turn is expensive. (I have tried
using ArrayAgg to fetch them in the same query as the Entity — no
improvement. It's possible that being able to join to entity_entity,
and then use ArrayAgg, would be better.)

Even once you've fetched them all, if the same entity appears many
times in an item, then get(..., keys=['layers']) duplicates the whole
JSON for the entity many times: expensive to serialize, expensive to
send over the wire.

Pandora's own web interface only depends on the 'id' key of 'entity' in
each annotation, and refetches the rest of the entity to show the pop-up
dialog when you press E. So by just not bothering to fetch and send any
other keys, get(..., keys=['layers']) on an item with many entity
annotations is substantially faster.

(I experimented with splitting the full entities off to one side, so,
you'd have:

    {
        "layers": {
            somelayer: [...,
              {..., "entity": {"id": ABC}},
            ], ...
        },
        "entities": {
            ABC: {...},
            ...
        }
    }

This is quicker than the status quo, but obviously not as fast as not
fetching & sending the rest at all!)
2016-04-28 14:15:23 +01:00
400b6650a2
Annotation.json: document empty-subtitle special case 2016-04-19 13:52:52 +01:00
af0d87b569
Annotation.json: reduce repeated layer lookups
It's actually quite costly to look up keys in CONFIG, particularly
inside a loop: this trims ~5% off get(keys=['layers']) for
annotation-heavy items.
2016-04-19 13:52:47 +01:00
b3df5b8d56 findAnnotations: match some fields case-sensitively
Requiring layer to have the right case is consistent with
addAnnotation(), and means the _layer[_like] index can be used. In my
testing, if itemsQuery specifies a single item, then postgres doesn't
bother with the layer index anyway; but if not, it makes a pretty big
(~3×) difference.

Matching public_id and item__public_id case-sensitively also seems
reasonable (it's consistent with get() and getAnnotation()).

(Is lower() redundant for the case-insensitive comparisons? ie. is
UPPER(x.lower()) == UPPER(x)? I'm not sure, it's cheap, let's leave it.)
2016-04-05 12:19:32 +01:00
8d1b4de337 findAnnotations(): make 'findvalue' the default key
Annotations have no 'name' field, so

     findAnnotations({query: {conditions: [{value: 'foo'}]}})

would previously raise an exception.
2016-04-05 12:19:31 +01:00
j
4f28c2c548 fix annotation import, values are decoded in d1.9 2016-03-05 15:36:47 +05:30
j
11924fcb0d Rename api.taskStatus to api.getTaskStatus
still register api.taskStatus since its used
in pandora_client and other scripts.

fixes #2600 and fixes #2859
2016-02-20 18:35:26 +05:30
j
051a3578b4 inline django 1.9 version of ox.django 2016-02-20 10:41:23 +00:00
j
4219246909 db migration 2016-02-20 15:15:01 +05:30
j
1cc795995d user.get_profile()->user.profile 2016-02-19 22:06:11 +05:30
j
e22cc432b3 use transaction.atomic 2016-02-19 21:55:09 +05:30
j
e738503380 remove old migrations 2016-02-19 15:17:18 +00:00
j
6b1ce30eb2 from __future__ import print_function 2016-02-18 16:19:26 +05:30
cdaa50c4d3 addAnnotations: report which key is missing in error 2016-02-04 10:38:02 +00:00
729856eb30 Rename getTaskStatus -> taskStatus in API docs (fixes #2859) 2016-02-04 10:38:01 +00:00
rolux
4ed2d940cf migrate annotation sequence in item not annotation 2015-10-12 15:24:03 +01:00
4f064fda76 Make Annotation.public_id non-NULLable (fixes #2829)
This fixes this race:

     request 1                          request 2
     -----------------------------      -------------------------
     addAnnotation(...)
     super(Annotation.self).save()
                                        findAnnotations(...)
                                        returns [{id: null, ...}]
     annotation.public_id = x
     returns {id: x}
2015-09-14 14:18:10 +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
ace04688f2 Entity.save(): update annotations async (fixes #2827, kinda) 2015-09-02 14:32:16 +02:00
j
83013bbe5e Update items when entities are renamed (fixes #2825) 2015-08-26 19:42:03 +02:00
j
819181726a slightly faster json serialization of annotations 2015-08-02 16:22:45 +02:00
d3c18a5859 editAnnotation: explicitly refuse to change layer, fixes #2818 2015-07-14 10:48:05 +02:00
1ef7101761 annotations: fix 'unkown' typo 2015-07-14 10:47:00 +02:00
j
ef56f4aec4 track annotation id in table to avoid IntegrityErrors while adding multiple annotations to one item, fixes #2780 2015-05-20 00:43:33 +05:30