fix: 更新图片下载路径为 /tmp/qqbot,确保头像和封面图片的下载和处理逻辑一致
This commit is contained in:
@@ -121,9 +121,13 @@ func getMyRecentScore(msg model.Message) (reply *model.Reply) {
|
||||
if _, err := os.Stat(util.GetResizedIamgePathByOrgPath(util.GenTempFilePath(songHash + ".jpeg"))); err == nil {
|
||||
return
|
||||
}
|
||||
util.DownloadFile(coverImageMap[songHash], util.GenTempFilePath(songHash+".jpeg"))
|
||||
newPath, err := util.ResizeImageByMaxHeight(util.GenTempFilePath(songHash+".jpeg"), 20)
|
||||
os.Remove(util.GenTempFilePath(songHash + ".jpeg"))
|
||||
filePath, err := util.DownloadFile(coverImageMap[songHash], "/tmp/qqbot")
|
||||
if err != nil {
|
||||
log.Printf("下载图片失败: %v", err)
|
||||
return
|
||||
}
|
||||
newPath, err := util.ResizeImageByMaxHeight(filePath, 20)
|
||||
os.Remove(filePath)
|
||||
if err != nil {
|
||||
log.Printf("缩放图片失败: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user