Make the Icecast input plugin link properly again.

master
Icedream 2018-07-02 11:39:53 +02:00
parent 0d8ecc64ad
commit c0774e8ba6
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
1 changed files with 7 additions and 1 deletions

View File

@ -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)
})
}