fix: 更新图片下载路径为 /tmp/qqbot,确保头像和封面图片的下载和处理逻辑一致

This commit is contained in:
lixiangwuxian
2025-04-10 01:47:17 +08:00
parent e3e1c31a68
commit bb6187dcc1
4 changed files with 20 additions and 16 deletions

View File

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