[radioob] update RadioListFormatter in order to display playlist
This commit is contained in:
parent
2d25289a68
commit
ee8e72f51c
1 changed files with 6 additions and 2 deletions
|
|
@ -34,13 +34,17 @@ __all__ = ['Radioob']
|
|||
|
||||
|
||||
class RadioListFormatter(PrettyFormatter):
|
||||
MANDATORY_FIELDS = ('id', 'title', 'description')
|
||||
MANDATORY_FIELDS = ('id', 'title')
|
||||
|
||||
def get_title(self, obj):
|
||||
return obj.title
|
||||
|
||||
def get_description(self, obj):
|
||||
result = '%-30s' % obj.description
|
||||
result = ''
|
||||
|
||||
if hasattr(obj, 'description') and not empty(obj.description):
|
||||
result += '%-30s' % obj.description
|
||||
|
||||
if hasattr(obj, 'current') and not empty(obj.current):
|
||||
if obj.current.who:
|
||||
result += ' (Current: %s - %s)' % (obj.current.who, obj.current.what)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue