From c0774e8ba697b2cd236302a0285d722bd81296f9 Mon Sep 17 00:00:00 2001 From: Carl Kittelberger Date: Mon, 2 Jul 2018 11:39:53 +0200 Subject: [PATCH] Make the Icecast input plugin link properly again. --- plugins/icecast/input/instance.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/icecast/input/instance.go b/plugins/icecast/input/instance.go index 25cd6de..f731b70 100644 --- a/plugins/icecast/input/instance.go +++ b/plugins/icecast/input/instance.go @@ -6,6 +6,7 @@ import ( "git.icedream.tech/icedream/uplink/app/authentication" "git.icedream.tech/icedream/uplink/app/channels" "git.icedream.tech/icedream/uplink/app/servers/http" + "git.icedream.tech/icedream/uplink/app/streams" "github.com/gin-gonic/gin" ) @@ -25,7 +26,9 @@ func (instance *pluginInstance) SetChannelManager(channelManager *channels.Chann func (instance *pluginInstance) SetServer(server *httpserver.Server) { instance.server = server +} +func (instance *pluginInstance) Init() { router := instance.server.Router router.PUT("/:channel", func(ctx *gin.Context) { @@ -43,6 +46,9 @@ func (instance *pluginInstance) SetServer(server *httpserver.Server) { ctx.Status(401) return } - io.Copy(channel.InputStream, ctx.Request.Body) + + input := channel.AddInputStream("icecast") + + io.Copy(input, sr) }) }