Use modify_bin and set_property to construct shoutcast output
This commit is contained in:
parent
4e232c981c
commit
ebe9bba9a9
@ -18,11 +18,12 @@ class ShoutcastOutput(BaseOutput):
|
||||
if settings.SHOUTCAST_OVERRIDE:
|
||||
return settings.SHOUTCAST_OVERRIDE
|
||||
|
||||
if not settings.SHOUTCAST_SERVER:
|
||||
return None
|
||||
return 'audioconvert ! %s ! shout2send name=shoutcast' \
|
||||
% settings.SHOUTCAST_ENCODER
|
||||
|
||||
description = ['audioconvert ! %s ! shout2send' % settings.SHOUTCAST_ENCODER]
|
||||
options = {
|
||||
def modify_bin(self, output):
|
||||
shoutcast = output.get_by_name('shoutcast')
|
||||
properties = {
|
||||
u'ip': settings.SHOUTCAST_SERVER,
|
||||
u'mount': settings.SHOUTCAST_MOUNT,
|
||||
u'port': settings.SHOUTCAST_PORT,
|
||||
@ -30,8 +31,6 @@ class ShoutcastOutput(BaseOutput):
|
||||
u'password': settings.SHOUTCAST_PASSWORD,
|
||||
}
|
||||
|
||||
for key, value in sorted(options.items()):
|
||||
for key, value in properties.items():
|
||||
if value:
|
||||
description.append('%s="%s"' % (key, value))
|
||||
|
||||
return u' '.join(description)
|
||||
shoutcast.set_property(key, value)
|
||||
|
||||
@ -183,8 +183,8 @@ MPD_SERVER_PORT = 6600
|
||||
#:
|
||||
#: Default::
|
||||
#:
|
||||
#: SHOUTCAST_SERVER = None # Must be set to enable shoutcase
|
||||
SHOUTCAST_SERVER = None
|
||||
#: SHOUTCAST_SERVER = u'127.0.0.1'
|
||||
SHOUTCAST_SERVER = u'127.0.0.1'
|
||||
|
||||
#: User to authenticate as against Shoutcast server.
|
||||
#:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user