Overhaul radio UI, fixes #93
This commit is contained in:
@ -260,9 +260,11 @@ class IrisCore(object):
|
||||
|
||||
# no uris means we can't play radio
|
||||
if not uris:
|
||||
self.radio['enabled'] = 0
|
||||
return {
|
||||
'status': 0,
|
||||
'message': 'No recommendations found'
|
||||
'message': 'No recommendations found',
|
||||
'radio': self.radio
|
||||
}
|
||||
|
||||
# if we got recommendations
|
||||
@ -279,6 +281,31 @@ class IrisCore(object):
|
||||
|
||||
return self.get_radio({})
|
||||
|
||||
def update_radio(self, data):
|
||||
self.radio = data
|
||||
self.radio['enabled'] = 1;
|
||||
|
||||
uris = self.load_more_tracks()
|
||||
|
||||
# no uris means we can't play radio
|
||||
if not uris:
|
||||
self.radio['enabled'] = 0
|
||||
return {
|
||||
'status': 0,
|
||||
'message': 'No recommendations found',
|
||||
'radio': self.radio
|
||||
}
|
||||
|
||||
# if we got recommendations
|
||||
else:
|
||||
self.core.tracklist.add( uris = uris )
|
||||
self.broadcast({
|
||||
'type': 'radio_updated',
|
||||
'radio': self.radio
|
||||
})
|
||||
|
||||
return self.get_radio({})
|
||||
|
||||
|
||||
def stop_radio(self, data):
|
||||
self.radio = {
|
||||
|
||||
Reference in New Issue
Block a user