Skip to content

🎧 Your Personal Streaming Service

Add timeout for artwork extraction

Deluan8cf78efb9c24
diff --git a/core/artwork.go b/core/artwork.go
index a0db2d2f6..72cb9df16 100644
--- a/core/artwork.go
+++ b/core/artwork.go
@@ -17,6 +17,7 @@ import (
"reflect"
"runtime"
"strings"
+ "time"
"github.com/dhowden/tag"
"github.com/disintegration/imaging"
@@ -46,6 +47,9 @@ type artwork struct {
}
func (a *artwork) Get(ctx context.Context, id string, size int) (io.ReadCloser, error) {
+ ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
+ defer cancel()
+
var artID model.ArtworkID
var err error
if id != "" {