Fix error when no artist/title
It's hard to reproduce the bug, I had it for a very short time, and didn't think of saving the HTTP responses.
This commit is contained in:
parent
b1298452d4
commit
7d1c232b38
1 changed files with 6 additions and 1 deletions
|
|
@ -66,7 +66,12 @@ class OuiFMBackend(BaseBackend, ICapRadio, ICapCollection):
|
|||
suffix = '_%s' % radio
|
||||
|
||||
last = document['last%s' % suffix][0]
|
||||
return last['artiste%s' % suffix].strip(), last['titre%s' % suffix].strip()
|
||||
artist = last['artiste%s' % suffix]
|
||||
title = last['titre%s' % suffix]
|
||||
if artist and title:
|
||||
return last['artiste%s' % suffix].strip(), last['titre%s' % suffix].strip()
|
||||
else:
|
||||
return artist, title
|
||||
|
||||
def get_radio(self, radio):
|
||||
if not isinstance(radio, Radio):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue