🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
refactor: removed indirect call introduced by intellij's refactor
Deluan59356f002960
diff --git a/engine/media_streamer.go b/engine/media_streamer.goindex 962c39ca4..b3d1381d9 100644--- a/engine/media_streamer.go+++ b/engine/media_streamer.go@@ -71,7 +71,7 @@ func (ms *mediaStreamer) NewStream(ctx context.Context, id string, maxBitRate inlog.Error(ctx, "Error starting transcoder", "id", mf.ID, err)return nil, os.ErrInvalid}- go copyAndClose(ctx, w, out)()+ go copyAndClose(ctx, w, out)}// If it is in the cache, check if the stream is done being written. If so, return a ReaderSeeker@@ -100,20 +100,18 @@ func (ms *mediaStreamer) NewStream(ctx context.Context, id string, maxBitRate inreturn s, nil}-func copyAndClose(ctx context.Context, w io.WriteCloser, r io.ReadCloser) func() {- return func() {- _, err := io.Copy(w, r)- if err != nil {- log.Error(ctx, "Error copying data to cache", err)- }- err = r.Close()- if err != nil {- log.Error(ctx, "Error closing transcode output", err)- }- err = w.Close()- if err != nil {- log.Error(ctx, "Error closing cache", err)- }+func copyAndClose(ctx context.Context, w io.WriteCloser, r io.ReadCloser) {+ _, err := io.Copy(w, r)+ if err != nil {+ log.Error(ctx, "Error copying data to cache", err)+ }+ err = r.Close()+ if err != nil {+ log.Error(ctx, "Error closing transcode output", err)+ }+ err = w.Close()+ if err != nil {+ log.Error(ctx, "Error closing cache", err)}}