添加对下载歌曲时封面图片大小的控制处理(#1609)

This commit is contained in:
lyswhut
2024-01-22 12:35:34 +08:00
parent c238d49584
commit 47635c95e1
3 changed files with 11 additions and 6 deletions
+2 -1
View File
@@ -59,7 +59,7 @@ const writeMeta = async(filePath, meta, picPath) => {
module.exports = (filePath, meta) => {
if (!meta.APIC) return writeMeta(filePath, meta)
const picUrl = meta.APIC
let picUrl = meta.APIC
delete meta.APIC
if (!/^http/.test(picUrl)) {
return writeMeta(filePath, meta)
@@ -67,6 +67,7 @@ module.exports = (filePath, meta) => {
let ext = path.extname(picUrl)
let picPath = filePath.replace(/\.flac$/, '') + (ext ? ext.replace(extReg, '$1') : '.jpg')
if (picUrl.includes('music.126.net')) picUrl += `${picUrl.includes('?') ? '&' : '?'}param=500y500`
download(picUrl, picPath).then(success => {
if (success) {
writeMeta(filePath, meta, picPath).finally(() => {