Don't save empty covers in mp3

This commit is contained in:
RemixDev 2021-06-19 12:02:58 +02:00
parent 27d44c172c
commit 638c621a4a

View file

@ -114,12 +114,14 @@ function tagID3(path, track, save){
if (save.cover && track.album.embeddedCoverPath){ if (save.cover && track.album.embeddedCoverPath){
const coverArrayBuffer = fs.readFileSync(track.album.embeddedCoverPath) const coverArrayBuffer = fs.readFileSync(track.album.embeddedCoverPath)
tag.setFrame('APIC', { if (coverArrayBuffer.length != 0){
type: 3, tag.setFrame('APIC', {
data: coverArrayBuffer, type: 3,
description: 'cover', data: coverArrayBuffer,
useUnicodeEncoding: save.coverDescriptionUTF8 description: 'cover',
}) useUnicodeEncoding: save.coverDescriptionUTF8
})
}
} }
tag.addTag() tag.addTag()