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){
const coverArrayBuffer = fs.readFileSync(track.album.embeddedCoverPath)
tag.setFrame('APIC', {
type: 3,
data: coverArrayBuffer,
description: 'cover',
useUnicodeEncoding: save.coverDescriptionUTF8
})
if (coverArrayBuffer.length != 0){
tag.setFrame('APIC', {
type: 3,
data: coverArrayBuffer,
description: 'cover',
useUnicodeEncoding: save.coverDescriptionUTF8
})
}
}
tag.addTag()