forked from 0x2620/pandora
api_api/update poster width/height
This commit is contained in:
parent
c9c597b378
commit
32375a9ff9
2 changed files with 15 additions and 0 deletions
|
@ -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()
|
||||
|
|
|
@ -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},
|
||||
|
|
Loading…
Reference in a new issue