I've narrowed it down to var covers = await track.loadCoverListAsync() not actually returning >0 for tracks when they are part of a playlist. Then again, 5% of the time they do return >0. And again they return >0 100% of the time when I play those same tracks manually.
Any idea where to debug this next?
Code: Select all
saveCoverToFile: async function(track, path){
// exports first cover of track
var _this = this;
var covers = await track.loadCoverListAsync()
console.debug(`covers.count= ${covers.count}`);
if(covers.count > 0){
await covers.whenLoaded(await covers.locked(async () =>{
var exportCover = await covers.getValue(0);
var ext = await _this.getCoverFileType(exportCover.pictureType);
var exportPath = `${path}\.${ext}`;
await exportCover.saveToFile(exportPath);
}))
}
},