No need to create a new instance of the Artwork service

This commit is contained in:
Deluan 2020-11-17 12:16:13 -05:00
parent af4609727c
commit 3c4903bc4e
1 changed files with 2 additions and 3 deletions

View File

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