Merge branch 'master' into old-engine

This commit is contained in:
nikk gitanes
2023-05-12 08:34:57 +03:00
25 changed files with 197 additions and 112 deletions

View File

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

View File

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