mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
Merge branch 'master' into old-engine
This commit is contained in:
@@ -207,7 +207,7 @@ func SetDefSettings() {
|
||||
if sets.ReadOnly {
|
||||
return
|
||||
}
|
||||
sets.SetDefault()
|
||||
sets.SetDefaultConfig()
|
||||
log.TLogln("drop all torrents")
|
||||
dropAllTorrent()
|
||||
time.Sleep(time.Second * 1)
|
||||
|
||||
@@ -2,9 +2,13 @@ package utils
|
||||
|
||||
import (
|
||||
"image"
|
||||
_ "image/gif"
|
||||
_ "image/jpeg"
|
||||
_ "image/png"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/image/webp"
|
||||
|
||||
"server/log"
|
||||
)
|
||||
@@ -19,7 +23,11 @@ func CheckImgUrl(link string) bool {
|
||||
return false
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
_, _, err = image.Decode(resp.Body)
|
||||
if strings.HasSuffix(link, ".webp") {
|
||||
_, err = webp.Decode(resp.Body)
|
||||
} else {
|
||||
_, _, err = image.Decode(resp.Body)
|
||||
}
|
||||
if err != nil {
|
||||
log.TLogln("Error decode image:", err)
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user