From ee8e72f51c4eb46dcc33f03c17ee217fb3bcb84c Mon Sep 17 00:00:00 2001 From: Bezleputh Date: Tue, 18 Feb 2014 23:06:07 +0100 Subject: [PATCH] [radioob] update RadioListFormatter in order to display playlist --- weboob/applications/radioob/radioob.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/weboob/applications/radioob/radioob.py b/weboob/applications/radioob/radioob.py index 13b45a50..de68365f 100644 --- a/weboob/applications/radioob/radioob.py +++ b/weboob/applications/radioob/radioob.py @@ -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)