modify radiofrance module to use the modified ICapRadio
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
dcad02eb29
commit
fe33234960
1 changed files with 12 additions and 6 deletions
|
|
@ -21,7 +21,8 @@
|
||||||
|
|
||||||
from weboob.capabilities.base import NotLoaded
|
from weboob.capabilities.base import NotLoaded
|
||||||
from weboob.capabilities.video import ICapVideo
|
from weboob.capabilities.video import ICapVideo
|
||||||
from weboob.capabilities.radio import ICapRadio, Radio, Stream, Emission
|
from weboob.capabilities.radio import ICapRadio, Radio
|
||||||
|
from weboob.capabilities.audiostream import BaseAudioStream, AudioStreamInfo
|
||||||
from weboob.capabilities.collection import ICapCollection, CollectionNotFound, Collection
|
from weboob.capabilities.collection import ICapCollection, CollectionNotFound, Collection
|
||||||
from weboob.tools.backend import BaseBackend
|
from weboob.tools.backend import BaseBackend
|
||||||
|
|
||||||
|
|
@ -142,8 +143,13 @@ class RadioFranceBackend(BaseBackend, ICapRadio, ICapCollection, ICapVideo):
|
||||||
# does not require it.
|
# does not require it.
|
||||||
self.fillobj(radio, ('current', ))
|
self.fillobj(radio, ('current', ))
|
||||||
|
|
||||||
stream = Stream(0)
|
stream = BaseAudioStream(0)
|
||||||
stream.title = u'128kbits/s' if hd else u'32kbits/s'
|
if hd:
|
||||||
|
stream.bitrate=128
|
||||||
|
else:
|
||||||
|
stream.bitrate=32
|
||||||
|
stream.format=u'mp3'
|
||||||
|
stream.title = u'%s kbits/s' % (stream.bitrate)
|
||||||
stream.url = url
|
stream.url = url
|
||||||
radio.streams = [stream]
|
radio.streams = [stream]
|
||||||
return radio
|
return radio
|
||||||
|
|
@ -174,9 +180,9 @@ class RadioFranceBackend(BaseBackend, ICapRadio, ICapCollection, ICapVideo):
|
||||||
title = self.browser.get_current_rss(radio.id)
|
title = self.browser.get_current_rss(radio.id)
|
||||||
if title:
|
if title:
|
||||||
if not radio.current or radio.current is NotLoaded:
|
if not radio.current or radio.current is NotLoaded:
|
||||||
radio.current = Emission(0)
|
radio.current = AudioStreamInfo(0)
|
||||||
radio.current.title = title
|
radio.current.what = title
|
||||||
radio.current.artist = artist
|
radio.current.who = artist
|
||||||
return radio
|
return radio
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue