fix formatting of bitrate

This commit is contained in:
rolux 2011-10-29 07:45:28 +00:00
commit 1266b82818
5 changed files with 13 additions and 7 deletions

View file

@ -387,7 +387,7 @@
"type": "integer",
"capability": "canSeeFiles",
"columnWidth": 60,
"format": {"type": "unit", "args": ["kbps"]}
"format": {"type": "value", "args": ["bps"]}
},
{
"id": "parts",
@ -538,7 +538,7 @@
{"id": "movies_with_clips", "title": "Movies with Clips", "query": {"conditions": [{"key": "canPlayClips", "value": true, "operator": "="}], "operator": "&"}},
{"id": "no_tv_series", "title": "No TV Series", "query": {"conditions": [{"key": "isSeries", "value": false, "operator": "="}], "operator": "&"}}
],
"rightsLevel": {"member": 5, "staff": 4, "admin": 3},
"rightsLevel": {"member": 4, "staff": 3, "admin": 2},
"rightsLevels": [
{"name": "Public", "color": [128, 255, 128]},
{"name": "Relaxed", "color": [192, 255, 128]},

View file

@ -500,7 +500,7 @@ class Stream(models.Model):
def json(self):
return {
'duration': self.duration,
'aspectRatio': self.aspect_ratio,
'aspectratio': self.aspect_ratio,
}
def delete_stream(sender, **kwargs):

View file

@ -88,7 +88,10 @@ class Clip(models.Model):
for a in self.annotations.filter(layer__name=layer)]
for key in keys:
if key not in clip_keys and key not in j:
j[key] = self.item.get(key)
value = self.item.get(key)
if not value and hasattr(self.item.sort, key):
value = getattr(self.item.sort, key)
j[key] = value
return j
@classmethod

View file

@ -168,6 +168,8 @@ class Item(models.Model):
objects = managers.ItemManager()
def get(self, key, default=None):
if key == 'rightslevel':
return self.level
if self.data and key in self.data:
return self.data[key]
if self.external_data and key in self.external_data:
@ -460,6 +462,7 @@ class Item(models.Model):
i['parts'] = len(i['durations'])
if i['parts']:
i['videoRatio'] = streams[0].aspect_ratio
i['resolution'] = (streams[0].file.width, streams[0].file.height)
#only needed by admins
if keys and 'posters' in keys:
@ -654,7 +657,7 @@ class Item(models.Model):
s.published = self.published
s.rightslevel = self.level
s.aspectratio = self.get('aspectRatio')
s.aspectratio = self.get('aspectratio')
s.words = sum([len(a.value.split()) for a in self.annotations.exclude(value='')])
s.clips = self.clips.count()

View file

@ -646,8 +646,8 @@ pandora.ui.infoView = function(data) {
return image.selected;
})[0];
$list = Ox.IconList({
defaultRatio: ui.icons == 'posters' ? 5/8 : data.stream.aspectRatio,
fixedRatio: ui.icons == 'posters' ? false : data.stream.aspectRatio,
defaultRatio: ui.icons == 'posters' ? 5/8 : data.stream.aspectratio,
fixedRatio: ui.icons == 'posters' ? false : data.stream.aspectratio,
item: function(data, sort, size) {
var ratio = data.width / data.height;
size = size || 128;