[suboob] don't show url if empty
This commit is contained in:
parent
58a37c3bfb
commit
9716dcbe7f
1 changed files with 6 additions and 2 deletions
|
|
@ -73,13 +73,17 @@ class SubtitleInfoFormatter(IFormatter):
|
|||
|
||||
|
||||
class SubtitleListFormatter(PrettyFormatter):
|
||||
MANDATORY_FIELDS = ('id', 'name', 'url')
|
||||
MANDATORY_FIELDS = ('id', 'name')
|
||||
|
||||
def get_title(self, obj):
|
||||
return obj.name
|
||||
|
||||
def get_description(self, obj):
|
||||
return 'lang : %s ; %s CD ; url : %s' % (obj.language, obj.nb_cd, obj.url)
|
||||
result = u'lang : %s' % obj.language
|
||||
result += ' ; %s CD' % obj.nb_cd
|
||||
if not empty(obj.url):
|
||||
result += ' ; url : %s' % obj.url
|
||||
return result
|
||||
|
||||
|
||||
class Suboob(ReplApplication):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue