diff --git a/pandora/config.indiancinema.jsonc b/pandora/config.indiancinema.jsonc index 5fc303815..c64929d43 100644 --- a/pandora/config.indiancinema.jsonc +++ b/pandora/config.indiancinema.jsonc @@ -539,6 +539,15 @@ "columnWidth": 60, "sort": true }, + { + "id": "numberofdocuments", + "title": "Number of Documents", + "type": "integer", + "columnWidth": 60, + "format": {"type": "number", "args": []}, + "sort": true, + "value": {"key": "documents", "type": "length"} + }, { "id": "numberoffiles", "title": "Number of Files", diff --git a/pandora/item/models.py b/pandora/item/models.py index e42d99225..f104687ea 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -748,6 +748,7 @@ class Item(models.Model): 'modified', 'numberofannotations', 'numberofcuts', + 'numberofdocuments', 'numberoffiles', 'parts', 'pixels', @@ -867,8 +868,9 @@ class Item(models.Model): for key in ('hue', 'saturation', 'lightness'): if key in self.data: setattr(s, key, self.data.get(key, None)) - s.numberofannotations = self.annotations.all().count() + s.numberofannotations = self.annotations.count() s.numberofcuts = len(self.data.get('cuts', [])) + s.numberofdocuments = self.documents.count() if s.duration: s.cutsperminute = s.numberofcuts / (s.duration/60) s.wordsperminute = s.words / (s.duration / 60)