do not write description line if there are only NotAvailable attributes

This commit is contained in:
Romain Bignon 2012-10-27 16:47:23 +02:00
commit 3fcc3333a0

View file

@ -39,6 +39,9 @@ class VideoListFormatter(PrettyFormatter):
return obj.title
def get_description(self, obj):
if empty(obj.duration) and empty(obj.date):
return None
result = '%s' % (obj.duration or obj.date)
if hasattr(obj, 'author') and not empty(obj.author):
result += u' - %s' % obj.author