[radiofrance] Cleanrly display live in repl
This commit is contained in:
parent
7654ded661
commit
f63212ea0e
1 changed files with 20 additions and 7 deletions
|
|
@ -268,15 +268,25 @@ class RadioFranceModule(Module, CapRadio, CapCollection, CapAudio):
|
||||||
for _id, item in sorted(self._RADIOS.iteritems()):
|
for _id, item in sorted(self._RADIOS.iteritems()):
|
||||||
if _id.startswith('fb'):
|
if _id.startswith('fb'):
|
||||||
yield Collection([_id], item['title'])
|
yield Collection([_id], item['title'])
|
||||||
elif len(split_path) == 2:
|
|
||||||
for _id, item in sorted(self._RADIOS.iteritems()):
|
elif len(split_path) > 1 and split_path[1] in self._RADIOS:
|
||||||
if _id == split_path[1]:
|
if len(split_path) == 2:
|
||||||
selection_url = self._RADIOS[_id]['selection']
|
yield Collection([split_path[0], u'direct'], u'Direct')
|
||||||
for item in self.browser.get_selection('francebleu', selection_url, _id):
|
yield Collection([split_path[0], u'selection'], u'Selection')
|
||||||
yield item
|
|
||||||
break
|
elif len(split_path) == 3 and split_path[2] == 'selection':
|
||||||
|
selection_url = self._RADIOS[split_path[1]]['selection']
|
||||||
|
for item in self.browser.get_selection('francebleu', selection_url, split_path[1]):
|
||||||
|
yield item
|
||||||
|
|
||||||
|
elif len(split_path) == 3 and split_path[2] == 'direct':
|
||||||
|
yield self.get_radio(split_path[1])
|
||||||
|
|
||||||
|
else:
|
||||||
|
raise CollectionNotFound(split_path)
|
||||||
|
|
||||||
elif len(split_path) == 1:
|
elif len(split_path) == 1:
|
||||||
|
yield Collection([split_path[0], u'direct'], u'Direct')
|
||||||
yield Collection([split_path[0], u'selection'], u'Selection')
|
yield Collection([split_path[0], u'selection'], u'Selection')
|
||||||
if 'podcast' in self._RADIOS[split_path[0]]:
|
if 'podcast' in self._RADIOS[split_path[0]]:
|
||||||
yield Collection([split_path[0], u'podcasts'], u'Podcast')
|
yield Collection([split_path[0], u'podcasts'], u'Podcast')
|
||||||
|
|
@ -295,6 +305,9 @@ class RadioFranceModule(Module, CapRadio, CapCollection, CapAudio):
|
||||||
split_path):
|
split_path):
|
||||||
yield item
|
yield item
|
||||||
|
|
||||||
|
elif len(split_path) == 2 and split_path[1] == 'direct':
|
||||||
|
yield self.get_radio(split_path[0])
|
||||||
|
|
||||||
elif len(split_path) == 3:
|
elif len(split_path) == 3:
|
||||||
podcasts_url = split_path[-1]
|
podcasts_url = split_path[-1]
|
||||||
if split_path[0] == 'franceculture':
|
if split_path[0] == 'franceculture':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue