mirror of
https://git.maid.zone/stuff/soundcloak.git
synced 2025-12-10 05:39:38 +05:00
in restream, download original track cover instead of resized
This commit is contained in:
@@ -2,10 +2,13 @@ package restream
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"image/jpeg"
|
"image"
|
||||||
"io"
|
"io"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
_ "image/jpeg"
|
||||||
|
_ "image/png"
|
||||||
|
|
||||||
"git.maid.zone/stuff/soundcloak/lib/cfg"
|
"git.maid.zone/stuff/soundcloak/lib/cfg"
|
||||||
"git.maid.zone/stuff/soundcloak/lib/misc"
|
"git.maid.zone/stuff/soundcloak/lib/misc"
|
||||||
"git.maid.zone/stuff/soundcloak/lib/preferences"
|
"git.maid.zone/stuff/soundcloak/lib/preferences"
|
||||||
@@ -230,6 +233,10 @@ func Load(r *fiber.App) {
|
|||||||
c.Set("Cache-Control", cfg.RestreamCacheControl)
|
c.Set("Cache-Control", cfg.RestreamCacheControl)
|
||||||
|
|
||||||
if isDownload {
|
if isDownload {
|
||||||
|
if t.Artwork != "" {
|
||||||
|
t.Artwork = t.Artwork[:len(t.Artwork)-len("t500x500.png")] + "original.jpg"
|
||||||
|
}
|
||||||
|
|
||||||
switch audio {
|
switch audio {
|
||||||
case cfg.AudioMP3:
|
case cfg.AudioMP3:
|
||||||
r := acquireReader()
|
r := acquireReader()
|
||||||
@@ -332,7 +339,7 @@ func Load(r *fiber.App) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defer resp.CloseBodyStream()
|
defer resp.CloseBodyStream()
|
||||||
parsed, err := jpeg.Decode(resp.BodyStream())
|
parsed, _, err := image.Decode(resp.BodyStream())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -418,7 +425,7 @@ func Load(r *fiber.App) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defer resp.CloseBodyStream()
|
defer resp.CloseBodyStream()
|
||||||
parsed, err := jpeg.Decode(resp.BodyStream())
|
parsed, _, err := image.Decode(resp.BodyStream())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user