strip artist and title

This commit is contained in:
Romain Bignon 2012-10-27 11:43:44 +02:00
commit 948f2b9ed2

View file

@ -87,7 +87,7 @@ class NovaBackend(BaseBackend, ICapRadio, ICapCollection):
doc = parser.parse(StringIO(html)) doc = parser.parse(StringIO(html))
artist = u' '.join([txt.strip() for txt in doc.xpath('//div[@class="artist"]')[0].itertext()]) artist = u' '.join([txt.strip() for txt in doc.xpath('//div[@class="artist"]')[0].itertext()])
title = u' '.join([txt.strip() for txt in doc.xpath('//div[@class="title"]')[0].itertext()]) title = u' '.join([txt.strip() for txt in doc.xpath('//div[@class="title"]')[0].itertext()])
return unicode(artist), unicode(title) return unicode(artist).strip(), unicode(title).strip()
def fill_radio(self, radio, fields): def fill_radio(self, radio, fields):
if 'current' in fields: if 'current' in fields: