diff --git a/pandora/backend/models.py b/pandora/backend/models.py index 41edfa572..30a4ff107 100644 --- a/pandora/backend/models.py +++ b/pandora/backend/models.py @@ -161,6 +161,10 @@ class Movie(models.Model): if not self.oxdbId: self.oxdbId = self.oxid() + if self.poster: + self.poster_height = self.poster.height + self.poster_width = self.poster.width + super(Movie, self).save(*args, **kwargs) self.updateFind() self.updateSort() diff --git a/pandora/backend/views.py b/pandora/backend/views.py index 7ca3a1023..29f98f520 100644 --- a/pandora/backend/views.py +++ b/pandora/backend/views.py @@ -60,6 +60,17 @@ def api(request): response['Access-Control-Allow-Origin'] = '*' return response +def api_api(request): + ''' + returns list of all known api action + return {'status': {'code': int, 'text': string}, + 'data': {actions: ['api', 'hello', ...]}} + ''' + actions = globals().keys() + actions = map(lambda a: a[4:], filter(lambda a: a.startswith('api_'), actions)) + actions.sort() + return render_to_json_response(json_response({'actions': actions})) + def api_hello(request): ''' return {'status': {'code': int, 'text': string},