From 3a420ab0c8e1fca51566d1d8b341f98b9c7e0d03 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 20 Oct 2011 10:24:41 +0200 Subject: [PATCH] prefs/aspect --- pandora/0xdb.jsonc | 1 - pandora/item/models.py | 5 +++-- pandora/padma.jsonc | 1 - static/js/pandora/ui/contactForm.js | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pandora/0xdb.jsonc b/pandora/0xdb.jsonc index cad0963b8..77dd498cd 100644 --- a/pandora/0xdb.jsonc +++ b/pandora/0xdb.jsonc @@ -562,7 +562,6 @@ ], "user": { "level": "guest", - "preferences": {}, "ui": { "annotationsSize": 256, "clipsColumns": 2, diff --git a/pandora/item/models.py b/pandora/item/models.py index 1fd6e37ac..a152fc78f 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -622,6 +622,7 @@ class Item(models.Model): s.modified = self.modified s.published = self.published + s.aspectratio = self.get('aspectRatio') # sort values based on data from videos s.words = sum([len(a.value.split()) for a in self.annotations.all()]) s.clips= self.clips.count() @@ -631,7 +632,8 @@ class Item(models.Model): s.duration = sum([v.duration for v in videos]) v = videos[0] s.resolution = v.width * v.height - s.aspectratio = float(utils.parse_decimal(v.display_aspect_ratio)) + if not s.aspectratio: + s.aspectratio = float(utils.parse_decimal(v.display_aspect_ratio)) s.pixels = sum([v.pixels for v in videos]) s.numberoffiles = self.files.all().count() s.parts = videos.count() @@ -644,7 +646,6 @@ class Item(models.Model): else: s.duration = None s.resolution = None - s.aspectratio = None s.bitrate = None s.pixels = None s.filename = None diff --git a/pandora/padma.jsonc b/pandora/padma.jsonc index d03fcc3cc..043f087b2 100644 --- a/pandora/padma.jsonc +++ b/pandora/padma.jsonc @@ -393,7 +393,6 @@ {"id": "timelines", "title": "Timelines", "items": [0, 1, 2, 3, 4, 5, 6, 7, 8]} ] }, - "preferences": {}, "ui": { "annotationsSize": 256, "find": {"index": -1, "key": "", "value": ""}, diff --git a/static/js/pandora/ui/contactForm.js b/static/js/pandora/ui/contactForm.js index 070ba4fee..be7fa2f3a 100644 --- a/static/js/pandora/ui/contactForm.js +++ b/static/js/pandora/ui/contactForm.js @@ -7,7 +7,7 @@ pandora.ui.contactForm = function() { id: 'email', label: 'E-Mail', labelWidth: 60, - value: pandora.user.preferences.email, + value: pandora.user.email, width: 240 }), Ox.Input({