From ef1f7e5cf124fdec1a87be3197fca0fc7ebcd25a Mon Sep 17 00:00:00 2001 From: Deluan Date: Tue, 17 Nov 2020 12:16:13 -0500 Subject: [PATCH] No need to create a new instance of the Artwork service --- core/artwork.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/artwork.go b/core/artwork.go index fab4e6723..7f747eaf9 100644 --- a/core/artwork.go +++ b/core/artwork.go @@ -149,9 +149,8 @@ func (a *artwork) getArtwork(ctx context.Context, id string, path string, size i } } else { // If requested a resized image, get the original (possibly from cache) and resize it - a2 := NewArtwork(a.ds, a.cache) buf := new(bytes.Buffer) - err = a2.Get(ctx, id, 0, buf) + err = a.Get(ctx, id, 0, buf) if err != nil { return } @@ -202,8 +201,8 @@ func readFromFile(path string) ([]byte, error) { if err != nil { return nil, err } - defer f.Close() + var buf bytes.Buffer if _, err := buf.ReadFrom(f); err != nil { return nil, err