From 2d4f4838129f2118c18589d8ff916d0f58a55eb4 Mon Sep 17 00:00:00 2001 From: Deluan Date: Tue, 19 Nov 2024 12:34:26 -0500 Subject: [PATCH] refactor: remove unnecessary intermediate buffer for ffmpeg image extraction Signed-off-by: Deluan --- core/artwork/sources.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/core/artwork/sources.go b/core/artwork/sources.go index 30dd88d27..03ebd162c 100644 --- a/core/artwork/sources.go +++ b/core/artwork/sources.go @@ -141,13 +141,7 @@ func fromFFmpegTag(ctx context.Context, ffmpeg ffmpeg.FFmpeg, path string) sourc if err != nil { return nil, "", err } - defer r.Close() - buf := new(bytes.Buffer) - _, err = io.Copy(buf, r) - if err != nil { - return nil, "", err - } - return io.NopCloser(buf), path, nil + return r, path, nil } }