Make the Icecast input plugin link properly again.
parent
0d8ecc64ad
commit
c0774e8ba6
|
@ -6,6 +6,7 @@ import (
|
||||||
"git.icedream.tech/icedream/uplink/app/authentication"
|
"git.icedream.tech/icedream/uplink/app/authentication"
|
||||||
"git.icedream.tech/icedream/uplink/app/channels"
|
"git.icedream.tech/icedream/uplink/app/channels"
|
||||||
"git.icedream.tech/icedream/uplink/app/servers/http"
|
"git.icedream.tech/icedream/uplink/app/servers/http"
|
||||||
|
"git.icedream.tech/icedream/uplink/app/streams"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -25,7 +26,9 @@ func (instance *pluginInstance) SetChannelManager(channelManager *channels.Chann
|
||||||
|
|
||||||
func (instance *pluginInstance) SetServer(server *httpserver.Server) {
|
func (instance *pluginInstance) SetServer(server *httpserver.Server) {
|
||||||
instance.server = server
|
instance.server = server
|
||||||
|
}
|
||||||
|
|
||||||
|
func (instance *pluginInstance) Init() {
|
||||||
router := instance.server.Router
|
router := instance.server.Router
|
||||||
|
|
||||||
router.PUT("/:channel", func(ctx *gin.Context) {
|
router.PUT("/:channel", func(ctx *gin.Context) {
|
||||||
|
@ -43,6 +46,9 @@ func (instance *pluginInstance) SetServer(server *httpserver.Server) {
|
||||||
ctx.Status(401)
|
ctx.Status(401)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
io.Copy(channel.InputStream, ctx.Request.Body)
|
|
||||||
|
input := channel.AddInputStream("icecast")
|
||||||
|
|
||||||
|
io.Copy(input, sr)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue